hi, here's a code snippet:
repeat for each line thisLine in field ParsingCurrent.HTMLText.Field
if matchText(thisLine,"(?Usi)(/\w+@[a-z_]+\.[a-z]{2,})",matchedEmail) then put matchedEmail after matchedList
end repeat
I have tried this several different ways. I even used only "(?Usi)href" as the regex and it wouldn't put anything into matchedList.
If I use:
if matchText(thisLine,"(?Usi)href", matchedEmail) then answer matchedEmail
it works.
The bottom line is, I can't get the PCRE expression up above to match any emails in the list I'm reading, and then I can't get anything that does match to create a new list in the matchedList variable.
Using matchText with PCRE
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
My first thought was that the repeat for each was putting the plain text of the field into "thisLine" each time, and so your sample for checking would not include the actual code, only the visible text.
I was going to suggest tryingbut on closer look, it seems your test with "answer matchedEmail" is working, so I'm not sure what the issue is.
I was going to suggest trying
Code: Select all
repeat for each line thisLine in the htmlText of field "ParsingCurrent.HTMLText.Field
"
try initialising matchedEmail before doing the matchtext e.g.
put empty into matchedEmail
The Dictionary says the variables used by matchText need to be "existing variables".
It might sound dumb, and if it turns out to be the action you need, then your working one liner:
if matchText(thisLine,"(?Usi)href", matchedEmail) then answer matchedEmail
should not be working either.
put empty into matchedEmail
The Dictionary says the variables used by matchText need to be "existing variables".
It might sound dumb, and if it turns out to be the action you need, then your working one liner:
if matchText(thisLine,"(?Usi)href", matchedEmail) then answer matchedEmail
should not be working either.