Hi all,

i have following written following regular expression :

([^)-0-9]*)([^-,]*)-([^-,]*)$


i have string in following format :

test 1 - test 2 - test 3

Using above expression i m getting middle part i.e. test 2 as a result.

Now the problem is that if the string doesnt contain any - (dash) then the above regular expression doesnt get anything as result.

let say i have following string :

test 1.

then it wont select anything.

Please help me in this so that the regular expression can work for both the given string formats.


Thanks in advance.