Sign in to follow this  
Followers 0
jvds

stringregexp searching help

4 posts in this topic

hi, i would like to know if i can set exclusions in a patern of stringregexp

$test =' <<--more-text--<span class="name"><a title="Maltem" href="/maltem_/fol"> Maltem</a></span>--some-more-text-->> '
$asResult = StringRegExp($test, '" href="/([\x00-\x7F]{1,})">', 1)
If @error == 0 Then
    MsgBox(0, "SRE Example 6 Result", $asResult[0])
EndIf

in this example my patern only focus starting from " href="/ and  "> but i want to include a longer string for the pattern

example=  '<span class="name"><a title=" Maltem " href="/maltem_/fol"> Maltem</a></span> '

but the pattern title item(Maltem) and text item(Maltem) may change along with the href(/maltem_/fol) item but i only whant to extract the href item

so I want to search the pattern to be like this ' <span class="name"><a title="EXCLUDE_FROM_SEARCH" href="([x00-x7F]{1,})"> EXCLUDE_FROM_SEARCH </a></span>'

is that possible to do with stringregexp?

tnx

Share this post


Link to post
Share on other sites



I don't understand what you're asking for. The pattern in your example does only extract the href part.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

it works but i want to use a larger pattern but ignore some parts of the pattern, example:
' <span class="name"><a title="EXCLUDE_FROM_SEARCH" href="([x00-x7F]{1,})"> EXCLUDE_FROM_SEARCH </a></span>'

Share this post


Link to post
Share on other sites

Look at what . (dot) means in a pattern by reading the StringRegExp page.

Still unclear why.

RegExping in html flow will always be less reliable than using IE functions.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0