Fix one Regex Line

Status
Not open for further replies.

Barchelor2

Member
21
2011
8
0
Hi im looking for someone to fix me one regex line:
Quote me a fair price, i have PP.

It already captures the text i want, but i need it to capture it only if its followed by a certain <div class=...>.

I could filter the captures comparing the strings... but its not "the plan".

Source:

<a href="chart-specs-model-name-code-82-etg-design-82t-3p-diessel-9999920131106-ftft.aspx" title="MODEL NAME WITH SPACES">
<div class="fieldft">

Im using now:
(?<=\<a href=")(.+?)(?=\" title)
This does the same but takes into account a new line:
(?<=\<a href=")(.+?)(?=\" title\=\".+?\"\>)\n*

Either of them captures the text i need: ---> chart-specs-model-name-code-82-etg-design-82t-3p-diessel-9999920131106-ftft.aspx
But it also captures other contents inside other a hrefs <a href="http://www.wjunction.com/92-development-area/..."> that i dont need

I unsuccessfully tried:

(?<=\<a href=").+?(?=\" title=".+?\">\n\<div class="fieldft">)

(?<=\<a href=").+?(?=\" title=".+?\">\n\(?=\</<div class="fieldft"\>)

I know i could use Xpath, but its not the plan, it must be Regex.

Thanks.

Details added..

__________________
Added after 1:

Details added
 
Last edited:
1 comment
Status
Not open for further replies.
Back
Top