Regex help needed
#1
Hey so im trying to find a pattern but im not that good at regex so would ask for some help here Smile

PHP Code:
<b><span style='font-size:18px'>bla.</span></b><br><br><img src='https://asdasdasd.jpg'><br><br><b>1x01 - <a style='text-decoration:underline;color:#ffffcc;font-family: verdana,geneva,sans-serif;' href='/?3980&tv=1'>Pilot</a></b> - (Original Air Date16-11-2004)<br><b>1x02 - <a style='text-decoration:underline;color:#ffffcc;font-family: verdana,geneva,sans-serif;' href='/?3981&tv=1'>Paternity</a></b> - (Original Air Date23-11-2004)<br><b>1x03 - <a style='text-decoration:underline;color:#ffffcc;font-family: verdana,geneva,sans-serif;' href='/?3982&tv=1'>Occam's Razor</a></b> - (Original Air Date: 30-11-2004)<br> 

this is my string. Where im trying to get ex: group1[1x01, /?3980&tv=1, Pilot] group2[1x02, /?3981&tv=1, Paternity], to be grouped.

i just want the pattern

thanks in advance Smile
Reply
#2
First, this is not the right area to post for any type of development help, and probably it will be moved.

but for your query,

<br><b>(.+?)<a.+?href='(.+?)'

should do the trick.
Reply
#3
(2017-02-16, 16:13)yocoldrain Wrote: First, this is not the right area to post for any type of development help, and probably it will be moved.

but for your query,

<br><b>(.+?)<a.+?href='(.+?)'

should do the trick.

Thank u very much for the example, it really helped me Smile

i will remember the next time to post it the right place :/

i ended up with: <br><b>(.+?)<a.+?href='(.+?)'>(.+?)</a>
Reply

Logout Mark Read Team Forum Stats Members Help
Regex help needed0