A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] [AS3] RegExp problems...

  1. #1
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378

    resolved [RESOLVED] [AS3] RegExp problems...

    Hey all, finally decided to migrate to AS3 (ashame I didn't do it sooner!), and I'm having some issues with the RegExp. I have a regexp that shows through both http://gskinner.com/RegExr/ and http://www.regexplanet.com/simple/index_html.jsp that the html:

    Code:
    <b>Genres:</b></font></td>
    <td valign="top"><font face=arial size=-1>Action/Adventure, Art/Foreign, Drama, Suspense/Horror, Thriller, Crime/Gangster and Adaptation</font></td>
    is 100% fully matched (including the grouping around the value) when I use the following test regexp:

    Code:
    /\<b\>Genres:\<\/b\>\<\/font\>\<\/td\>\s+\<td\svalign\=\"top\"\>\<font\sface\=arial\ssize\=-1\>([a-zA-Z0-9,.\/ ]+)\<\/font\>\<\/td\>/gi
    Basically what I am trying to do is make an array of regexp codes to loop through a URLLoader's result and pick out all the values. The problem comes when I try to write the above code into the CS4 IDE. It's not recognizing the second " at \"top\". Everything until the end of the line and all following lines are treated as a string until the next " is found. The issue goes away if I add an extra \ before the escape character of the second ", but then the regexp fails, obviously. Any ideas why testers show this works and the IDE hates it?
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  2. #2
    Senior Member bluemagica's Avatar
    Join Date
    Jun 2008
    Posts
    766
    hmm....sorry I have no experience with these, but try \"top\]*"
    If you like me, add me to your friends list .

    PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!

    My Arcade My Blog

    Add me on twitter:

  3. #3
    Senior Member
    Join Date
    May 2009
    Posts
    138
    Code:
    .*<font.*?>(.+)<\/font>.*
    or if you want to only catch font tags in table cells..

    Code:
    .*<td.*?><font.*?>(.+)<\/font><\/td>.*
    as to why the quote is screwing up in CS4, I couldn't tell ya.

  4. #4
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    Thanks, that solved it.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center