I need a regex to match the the text between tags that are also nested between
tags - for example:
this text
I started using this: (?<=)[\s\S]*?(?=
) which does match the text between the header tag, I also started playing around with [\s\S]*?
to retrieve links which also works, but I am having problems when trying to combine the 2 together in one pattern.I might be going about this the wrong way altogether! I am new to regex and am still trying to learn, any help with this will be greatly appreciated!!
Krishna
Kirtan PatelPosted Oct 16, 2009, 9:24 AM
Here is What you want
The ReGeX You want is below
(?<=
)[\s\S]*?(?=
)please dont forget to mark "Do you like this anwer" it is very important to me :-)
K CPosted Oct 16, 2009, 11:33 AM
I ended up with this:
(?<=
[^>]*]*>)[\s\S]*?(?=[^>]*
)as I had a lot of characters in the href="" that I was not prepared for!
Thanks very much!!
Kirtan PatelPosted Oct 16, 2009, 10:03 AM
You Cheated ,
Why you copy pasted my regex to your post ???
at least if you cant answer dont copy paste others answer
I will complain about this to Mr mahesh
:X
Roei BarPosted Oct 16, 2009, 9:22 AM
http://kevin.deldycke.com/2007/03/ultimate-regular-expression-for-html-tag-parsing-with-php/
i think this is what you need :
(?<=
)[\S\s]*?(?=
)