Link to home
Start Free TrialLog in
Avatar of cmallela
cmallela

asked on

Regular Expression - please help .. URGENT !

dear experts,

can anybody give me the regular expression for "////<br>*////" (i.e., four forward slashes, followed by any number of <br>s and followed by four forward slashes). its urgent .. please help me as soon as possible. also, give me some links to know more about the regular expressions.

thanks in advance.
Avatar of cmallela
cmallela

ASKER

please note that i want it in java in the function String.replaceAll(regex,string). thanks
Avatar of CEHJ
"////////<br>*////////"
You were right first time - (sorry was thinking backslash)

"////<br>*////"
You want to replace what by what?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you mean you want to surround the <br> tags with 4 forward slashes then try

s = s.replaceAll("(<br>+)", "////$1////");

General RE info:

http://java.sun.com/docs/books/tutorial/extra/regex/
thanks everybody for very quick replies. i didnt realize that i didnt put the brackets (very dumb huh!)...
 
thanks so much.
>>please note that i want it in java in the function String.replaceAll(regex,string). thanks

cmallela, can you tell me how that accepted answer answers the question?
well, my question was -

>> can anybody give me the REGULAR EXPRESSION for "////<br>*////" ,

However, I just mentioned that I want that particular regex in the function String.replaceAll .. but after all I wanted only the regex. However, I wanted to split the points but its such a easy question (in fact I was dumb), that I had to just select one answer and thus I selected that answer.

Sorry if that offended you but really appreciate your input on this.

Thanks.
>>However, I wanted to split the points

Well you could have done, and in fact you can now still..!