I am not very good at regular expression but want to do some thing like this :
string="c test123 d split"
I want to split the word based on "c" and "d". this can be any word which i already have. The string will be given by the user. i want "test123" and "split" as my output. and there can be any number of words i.e "c test123 d split e new" etc. c d e i have already with me. I want just the next word after that word i.e after c i have test123 and after d i have split and after e i have new so i need test123 and split and new. how can I do this??? And one more thing I will pass just c first than d and than e. not together all of them. I tried
string strSearchWord="c ";
Regex testRegex1 = new Regex(strSearchWord); List lstValues = testRegex1.Split("c test123 d split").ToList();
But it's working only for last character i.e for d it's giving the last word but for c it includes test123 d split.
How shall I do this???
The input might be
string strSearchWord="c mytest1 d newtest1 e lasttest1"; split should be based on characters "c d and e". I will pass them one by one.
or
string strSearchword="q 100 p 200 t 2000"; split should be based on characters "q p and t". I will pass them one by one.
or string strSearchWord="t 100 r pass"; split should be based on characters "t r". I will pass them one by one.
or
string strSeaRCHwORD="fi 100 se 2000 td 500 ft 200 fv 6000 lt thanks "; split should be based on characters "fi,se,td,ft,fv and lt". I will pass them one by one.
Hope it's clear. Any other specification????