Solved

Regular Expression - please help .. URGENT !

Posted on 2004-10-29
180 Views
Last Modified: 2010-03-31
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.
0
Question by:cmallela
    12 Comments
     

    Author Comment

    by:cmallela
    please note that i want it in java in the function String.replaceAll(regex,string). thanks
    0
     
    LVL 86

    Expert Comment

    by:CEHJ
    "////////<br>*////////"
    0
     
    LVL 86

    Expert Comment

    by:CEHJ
    You were right first time - (sorry was thinking backslash)

    "////<br>*////"
    0
     
    LVL 86

    Expert Comment

    by:CEHJ
    You want to replace what by what?
    0
     
    LVL 3

    Expert Comment

    by:Gunt
    0
     
    LVL 92

    Accepted Solution

    by:
    "////(<br>)*////"
    0
     
    LVL 86

    Expert Comment

    by:CEHJ
    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/
    0
     

    Author Comment

    by:cmallela
    thanks everybody for very quick replies. i didnt realize that i didnt put the brackets (very dumb huh!)...
     
    thanks so much.
    0
     
    LVL 92

    Expert Comment

    by:objects
    (:
    0
     
    LVL 86

    Expert Comment

    by:CEHJ
    >>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?
    0
     

    Author Comment

    by:cmallela
    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.
    0
     
    LVL 86

    Expert Comment

    by:CEHJ
    >>However, I wanted to split the points

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    877 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now