Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By pbrockway2

Thread: Help figuring out a regular expression!

  1. #1
    srs
    srs is offline Member
    Join Date
    Dec 2011
    Posts
    1
    Rep Power
    0

    Default Help figuring out a regular expression!

    I am writing a simple html parser (the HTML is in a one-line text file already on disk). After it reads the file, I'd like it to look for all instances of an anchor tag set which use a specific class (<a class="someClass"...).

    Examples:
    <a class="someClass" href="someURL1">SomeText1</a>
    <a class="someClass" href="someURL2">SomeText2</a>

    So the program will read the file, scan through it for all instances of anchor tags that start like this: <a class="someClass" and print out (to console) the plain text (SomeText1, SomeText2, etc.) found betwen the opening/closing anchor tags.

    Would someone be able to figure out the regular expression to do this?

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Help figuring out a regular expression!

    Would someone be able to figure out the regular expression to do this?
    If you have no lucking getting someone to do this for you try the regular expressions section of Oracle's Tutorial and the information at regular-expressions.info.
    DarrylBurke likes this.

Similar Threads

  1. Regular Expression Help
    By niketanand in forum Advanced Java
    Replies: 1
    Last Post: 06-24-2011, 04:56 PM
  2. regular expression
    By ehsansad in forum New To Java
    Replies: 8
    Last Post: 03-18-2011, 02:23 PM
  3. regular expression
    By prof.deedee in forum JDBC
    Replies: 3
    Last Post: 02-19-2010, 11:15 AM
  4. regular expression
    By QkrspCmptPop in forum Advanced Java
    Replies: 8
    Last Post: 01-20-2010, 03:55 AM
  5. regular expression
    By ras_pari in forum Advanced Java
    Replies: 27
    Last Post: 10-07-2009, 12:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •