Jump to content
souldjer777

StringRegExp - Pattern fails so is there a specific language I should be using?

Recommended Posts

souldjer777

Good Afternoon Everyone,

First and foremost, thank you for doing what you guys do. I use AutoIT almost every day. It helps the world out... so yes, thank you everyone, sincerely.

This is my Regular Expression:

<tr>.*(\n|\n.*\n)^<td>.*\n^<td>.*\d{1,2}\sJune\s2014.[\S\s]*?\n</tr>

or

<tr>.*(\n|\n.*\n)^<td>.*\n^<td>.*\d{1,2}\sMay\s2014.[\S\s]*?\n</tr>

HTML CODE:

</tr><tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6296_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6296">OS X Mavericks 10.9.4 and Security Update 2014-003</a></td>
<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks 10.9 to 10.9.3</td>
<td>30 June 2014</td>
</tr><tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6293_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6293">Safari 6.1.5 and Safari 7.0.5</a></td>
<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>
<td>30 June 2014</td>
</tr><tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6254_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6254">Safari 6.1.4 and Safari 7.0.4</a></p>
</td>
<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>
<td><p>21 May 2014</p>
</td>
</tr><tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6248_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6248">OS X Server 3.1.2</a></p>
</td>
<td>OS X Mavericks 10.9.3 or later</td>
<td><p>20 May 2014</p>
</td>
</tr><tr>

This matches html with tags like <tr> , new lines \n as in Line Feed, digits \d, spaces \s, literal strings like "June" and any character .[\S\s]*? between zero and unlimited times.

As I bash my head against the wall - I thank you for your help!

:mad2:

PCRE regular expression engine updated to 8.34

#include <Array.au3>

$test = ""
$test &= '</tr><tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6296_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6296">OS X Mavericks 10.9.4 and Security Update 2014-003</a></td>' & @CRLF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks 10.9 to 10.9.3</td>' & @CRLF
$test &= '<td>30 June 2014</td>' & @CRLF
$test &= '</tr><tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6293_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6293">Safari 6.1.5 and Safari 7.0.5</a></td>' & @CRLF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>' & @CRLF
$test &= '<td>30 June 2014</td>' & @CRLF
$test &= '</tr><tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6254_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6254">Safari 6.1.4 and Safari 7.0.4</a></p>' & @CRLF
$test &= '</td>' & @CRLF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>' & @CRLF
$test &= '<td><p>21 May 2014</p>' & @CRLF
$test &= '</td>' & @CRLF
$test &= '</tr><tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6248_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6248">OS X Server 3.1.2</a></p>' & @CRLF
$test &= '</td>' & @CRLF
$test &= '<td>OS X Mavericks 10.9.3 or later</td>' & @CRLF
$test &= '<td><p>20 May 2014</p>' & @CRLF
$test &= '</td>' & @CRLF
$test &= '</tr><tr>' & @CRLF

MsgBox (0,"", $test)

$AppleMonthName = "June"

Local $aArray = StringRegExp ($test, '<tr>.*\n<td>.*\n<td>\d\d\s' & $AppleMonthName & '\s2014</td>\n</tr>', $STR_REGEXPARRAYGLOBALFULLMATCH)

Local $aMatch = 0
For $i = 0 To UBound($aArray) - 1
    $aMatch = $aArray[$i]
    For $j = 0 To UBound($aMatch) - 1
        MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 4 - " & $i & ',' & $j, $aMatch[$j])
    Next
Next

$AppleMonthName = "May"

Local $aArray = StringRegExp ($test, '<tr>.*\n<td>.*\n<td>\d\d\s' & $AppleMonthName & '\s2014</td>\n</tr>', $STR_REGEXPARRAYGLOBALFULLMATCH)

Local $aMatch = 0
For $i = 0 To UBound($aArray) - 1
    $aMatch = $aArray[$i]
    For $j = 0 To UBound($aMatch) - 1
        MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 4 - " & $i & ',' & $j, $aMatch[$j])
    Next
Next


Exit

 

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
mikell

What is exactly the expected result ?

Share this post


Link to post
Share on other sites
souldjer777

Expected result would be either

<tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6293_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6293">Safari 6.1.5 and Safari 7.0.5</a></td>
<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>
<td>30 June 2014</td>
</tr>

...

etc

or

<tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6254_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6254">Safari 6.1.4 and Safari 7.0.4</a></p>
</td>
<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>
<td><p>21 May 2014</p>
</td>
</tr>

...

etc

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
mikell

Why not just like this ?

#include <Array.au3>

$test = ""
$test &= '</tr><tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6296_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6296">OS X Mavericks 10.9.4 and Security Update 2014-003</a></td>' & @CRLF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks 10.9 to 10.9.3</td>' & @CRLF
$test &= '<td>30 June 2014</td>' & @CRLF
$test &= '</tr><tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6293_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6293">Safari 6.1.5 and Safari 7.0.5</a></td>' & @CRLF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>' & @CRLF
$test &= '<td>30 June 2014</td>' & @CRLF
$test &= '</tr><tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6254_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6254">Safari 6.1.4 and Safari 7.0.4</a></p>' & @CRLF
$test &= '</td>' & @CRLF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>' & @CRLF
$test &= '<td><p>21 May 2014</p>' & @CRLF
$test &= '</td>' & @CRLF
$test &= '</tr><tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6248_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6248">OS X Server 3.1.2</a></p>' & @CRLF
$test &= '</td>' & @CRLF
$test &= '<td>OS X Mavericks 10.9.3 or later</td>' & @CRLF
$test &= '<td><p>20 May 2014</p>' & @CRLF
$test &= '</td>' & @CRLF
$test &= '</tr><tr>' & @CRLF

;MsgBox (0,"", $test)

Local $aArray = StringRegExp ($test, '(?s)<tr>.*?</tr>', 3)

$AppleMonthName = "June"

For $i = 0 To UBound($aArray) - 1
    If StringInStr($aArray[$i], $AppleMonthName) Then MsgBox(0, $AppleMonthName, $aArray[$i])
Next

$AppleMonthName = "May"

For $i = 0 To UBound($aArray) - 1
    If StringInStr($aArray[$i], $AppleMonthName) Then MsgBox(0, $AppleMonthName, $aArray[$i])
Next

 

Share this post


Link to post
Share on other sites
souldjer777

Well that's the kicker... I really want to learn regular expressions so I'm using PCRE 8.34-8.35 UTF-32 now as a regex language... and it works in RegexBuddy... but fails in AutoIT.

<tr>\N*(\n|\n\N*\n){1,2}<td>\N+\n<td>\N*2014\p{Any}*?</tr>

This is sadly blowing my mind.

I'll check out your script and give it a whirl, problem is, I don't use this stuff enough and I need a good source.


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
souldjer777

That one above actually worked... now to figure out the array...

<tr>\N*(\n|\n\N*\n){1,2}<td>\N+\n<td>\N*2014\p{Any}*?</tr>


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
souldjer777

Thank you Mikell - I appreciate the help!

The reason I can't do just the table row <tr> tags is because that code above is just a snippet / small example of all the html code. I had to find matching dates for month and year.

Thank you though! I think I'm good now. Going to keep testing.


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
souldjer777

Good Morning All

:)

I was hoping someone could tell me what the following code finds blanks... and single tags </td>

Thank you!

#include <Array.au3>
#include <MsgBoxConstants.au3>
#include <StringConstants.au3>

$test = ""
$test &= '</tr><tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6296_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6296">OS X Mavericks 10.9.4 and Security Update 2014-003</a></td>' & @LF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks 10.9 to 10.9.3</td>' & @LF
$test &= '<td>30 June 2014</td>' & @LF
$test &= '</tr><tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6293_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6293">Safari 6.1.5 and Safari 7.0.5</a></td>' & @LF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>' & @LF
$test &= '<td>30 June 2014</td>' & @LF
$test &= '</tr><tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6254_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6254">Safari 6.1.4 and Safari 7.0.4</a></p>' & @LF
$test &= '</td>' & @LF
$test &= '<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>' & @LF
$test &= '<td><p>21 May 2014</p>' & @LF
$test &= '</td>' & @LF
$test &= '</tr><tr><td><p><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6248_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6248">OS X Server 3.1.2</a></p>' & @LF
$test &= '</td>' & @LF
$test &= '<td>OS X Mavericks 10.9.3 or later</td>' & @LF
$test &= '<td><p>20 May 2014</p>' & @LF
$test &= '</td>' & @LF
$test &= '</tr><tr>' & @LF

MsgBox (0,"", $test)

Local $aArray = StringRegExp ($test, '<tr>\N*(\n|\n\N*\n){1,2}<td>\N+\n<td>\N*\sJune\s2014\p{Any}*?</tr>', $STR_REGEXPARRAYGLOBALFULLMATCH)

Local $aMatch = 0
For $i = 0 To UBound($aArray) - 1
    $aMatch = $aArray[$i]
    For $j = 0 To UBound($aMatch) - 1
        MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 4 - " & $i & ',' & $j, $aMatch[$j])
    Next
Next

Local $aArray = StringRegExp ($test, '<tr>\N*(\n|\n\N*\n){1,2}<td>\N+\n<td>\N*\sMay\s2014\p{Any}*?</tr>', $STR_REGEXPARRAYGLOBALFULLMATCH)

Local $aMatch = 0
For $i = 0 To UBound($aArray) - 1
    $aMatch = $aArray[$i]
    For $j = 0 To UBound($aMatch) - 1
        MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 4 - " & $i & ',' & $j, $aMatch[$j])
    Next
Next


Exit

 

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
Jury

Re UTF did you see this information in the help file for StringRegExp:

"This implementation includes Unicode Category Properties (UCP) support, which allows fine-grain processing of most human languages.
However to maintain compatibility with previous versions and keep matching speed at its best, the UCP support is not enabled by default. You can enable it by prepending the string (*UCP) at the very start of your pattern. When enabled, the UCP setting changes the extend of a number of regular expression elements, as documented below where applicable."

So for example to change all types of dashes to * :

$sFileRead = StringRegExpReplace($sFileRead, '(*UCP)\p{Pd}', '*')

but I don't understand \p{Any}

BTW I see it means:

Match a character from the Unicode category any (any code point, regardless or whether it is assigned)

 

 

Edited by Jury

Share this post


Link to post
Share on other sites
souldjer777

Sweet thank you Jury

:rambo:

\p{Any} matches any character from the Unicode category "any" (any code point, regardless of whether it is assigned)

*? between zero and unlimited times, as few times as possible, expanding as needed (lazy)

Trying your *UCP now...

Nope, no change... (*UCP)<tr>\N*(\n|\n\N*\n){1,2}<td>\N+\n<td>\N+\s\May\s2014\p{Any}*?</tr>

What would you put in place of Any... if my above description helps...

Thanks!

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
Jury

also shouldn't:

$STR_REGEXPARRAYGLOBALFULLMATCH

just be:

3

Share this post


Link to post
Share on other sites
souldjer777

Just following examples, yes, that's fine - it's an equivalent.

It's actually a 4.
 

Local $aArray = StringRegExp ($OpenSSL01, '(*UCP)<tr>\N*(\n|\n\N*\n){1,2}<td>\N+\n<td>\N+\s\June\s2014\p{Any}+?</tr>', 4)


 

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
Jury

what are you getting as out put?  I get something like:
 

</tr> <tr> <td> < a
onclick="s_objectID=&quot;

http://support.apple.com/kb/HT6296_l&quot;;retur
n this.s_oc?this.s_oc(e):true" href='
'http://support.apple.com/kb/HT6296">OSX
Mavericks 10.9.4 and Security Update 2014-003</a> </td>
<td> OS X Lion vlO.7.5, OS X Mountain Lion vlO.8.5, OS X Mavericks 10.9 to
10.9.3</td>
<td>30 June2014</td>


</tr><tr><td><a
onclick="s_objectID=&quot;
http://support.apple.com/kb/HT6293_l&quot;;retur
n this.s_oc?this.s_oc(e):true" href=
"http://suppott.apple.com/kb/H~T6293">Safari
6.1.5 and Safari 7.0.5</a></td>
<td>OSX Lion vlO.7.5, OS X Mountain Lion vlO.8.5, OS X Mavericks vl0.9.3</td>
<td>30 June2014</td>


</tr> <tr> <td> < p>< a
onclick=''s_objectID=&quot;
http://support.apple.com/kb/HT6254_l&quot;;retur
n this.s_oc?this.s_oc(e):true" href='
'http://support.apple.com/kb/H~T6254''>Safari
6.1.4 and Safari7.0.4</a></p>
</td>
<td>OS X Lion vlO.7.5, OS X Mountain Lion vlO.8.5, OS X Mavericks vl0.9.3</td>
<tdxp>21 May2014</p>
</td>


</tr> <tr> <td> < p>< a
onclick=''s_objectID=&quot;
http://support.apple.com/kb/HT6248_l&quot;;retur
n this.s_oc?this.s_oc(e):true" href=
"http://support.apple.com/kb/HT6248">OSX
Server 3.1.2</a> </p>
</td>
<td> OS X Mavericks 10.9.3 or later</td>
<tdxp>20 May2014</p>
</td>
</tr> <tr>

Share this post


Link to post
Share on other sites
souldjer777

Right, that is the output of the first MsgBox... MsgBox (0,"", $test)

But you should also get output from the For Next loop that has a MsgBox in there...

MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 4 - " & $i & ',' & $j, $aMatch[$j])

I've gotten strange results within that loop...

---------------------------
RegExp Test with Option 4 - 0,0
---------------------------
<tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6296_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6296">OS X Mavericks 10.9.4 and Security Update 2014-003</a></td>
<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks 10.9 to 10.9.3</td>
<td>30 June 2014</td>
</tr>

---------------------------
OK   
---------------------------
---------------------------
RegExp Test with Option 4 - 0,1
---------------------------


---------------------------
OK   
---------------------------
---------------------------
RegExp Test with Option 4 - 1,0
---------------------------
<tr><td><a onclick="s_objectID=&quot;http://support.apple.com/kb/HT6293_1&quot;;return this.s_oc?this.s_oc(e):true" href="http://support.apple.com/kb/HT6293">Safari 6.1.5 and Safari 7.0.5</a></td>
<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>
<td>30 June 2014</td>
</tr>
---------------------------
OK   
---------------------------
---------------------------
RegExp Test with Option 4 - 1,1
---------------------------


---------------------------
OK   
---------------------------

etc...

It's like I'm in a 2D array and it's reading empty values... except when searching for "May" I get different results as well - strange... don't get it.
 

---------------------------
RegExp Test with Option 4 - 0,0
---------------------------
<tr><td><p><a href="http://support.apple.com/kb/HT6254">Safari 6.1.4 and Safari 7.0.4</a></p>
</td>
<td>OS X Lion v10.7.5, OS X Mountain Lion v10.8.5, OS X Mavericks v10.9.3</td>
<td><p>21 May 2014</p>
</td>
</tr>
---------------------------
OK   
---------------------------
---------------------------
RegExp Test with Option 4 - 0,1
---------------------------

</td>

---------------------------
OK   
---------------------------
---------------------------
RegExp Test with Option 4 - 1,0
---------------------------
<tr><td><p><a href="http://support.apple.com/kb/HT6248">OS X Server 3.1.2</a></p>
</td>
<td>OS X Mavericks 10.9.3 or later</td>
<td><p>20 May 2014</p>
</td>
</tr>
---------------------------
OK   
---------------------------
---------------------------
RegExp Test with Option 4 - 1,1
---------------------------

</td>

---------------------------
OK   
---------------------------

 

Edited by souldjer777

"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
souldjer777

Also, why can't I see the array text if I do an _ArrayDisplay ( $aArray ) ?


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
jchd

Jury,

\p{Any} matches any Unicode character. Of course the opposite, \P{Any} never matches.

\p{Pd} matches "dot punctuation" characters (not dashes and like), but \p{Po} does match dashes and a number of "other punctuation" characters.


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
souldjer777

Dude, FYI... I have to say I LOVE your "JE SUIS CHARLIE". I remember that like it was yesterday. Unbelievable what the terrorists did... you can never give up freedom of speech or you forfeit your humanity. - Yes, I'll stick to topic for now on... but that's something I've been meaning to say to you.


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

Share this post


Link to post
Share on other sites
jchd

Thanks for all those who paid a high price for their freedom.

Anyway, I also question the need for (*UCP) since I don't see the need for it, at least in the examples given (maybe overlooking something). It doesn't harm to use it anyway if you expect to process anything not english.


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
mikell

I've gotten strange results within that loop...

Also, why can't I see the array text if I do an _ArrayDisplay ( $aArray ) ?

​1/ For the empty results trouble, use a non capturing group  (?:\n|\n\N*\n){1,2}

2/ $aArray is an array of arrays
_ArrayDisplay($aArray)  doesn't work because it makes a listview and you can't display an array in a listview item  :)

Share this post


Link to post
Share on other sites
souldjer777

Any idea how I start matching a line at say... the sixth character? As in... how do I start matching the beginning of a line like </tr><tr> at <tr> ?

Thanks!


"Maybe I'm on a road that ain't been paved yet. And maybe I see a sign that ain't been made yet"
Song Title: I guess you could say
Artist: Middle Class Rut

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

  • Similar Content

    • VollachR
      By VollachR
      Hi,
      I'm looking for a way to take a number value from a Row2 of a 2D array and according to this check if files that appear in rows 3-11 in the array exists.
      For example, if the number in Row2 is 5 I need to check for the files in Row 3-6 only, if it is 6 than rows 3-7 and so on.
      I thought on using a FOR loop but I have very little experience with those.
      Can you suggest the best way to do what I need?
      BTW, the files in Rows 3-11 will usually have blank value for any row above the number in Row2 (e.g. Row2 = 5 so Rows3-6 will have values but 8-11 be empty), The values I need are in Column 1 of the array, the name of the key from the INI file that the array was created from is in Column 0.
      Full Example:
      Row2 of Array:
      Col0 = Games# - Col1 = 5
      Rows3-6
      Col0 = Exe2 - Col1 = Path To File
      Col0 = Exe3 - Col1 = Path To File
      Col0 = Exe4 - Col1 = Path To File
      Col0 = Exe5 - Col1 = Path To File
      I need that if Row2 is 5 to check these above for rows if the file exists, if it was 6 then the next row as well and so on up until number 10 in Row2 as it can't go above 10.
      So basically for whatever number in Row2 from 2-10 need to check 1-9 rows from 3-11 to see if the files in Col1 exists and if any of them don't exist it should call a function that shows an error message.
      I'm pretty sure I have the first line of the for look correct:
      For $i = 1 To $aAIO[2][1] Just not sure how to continue from there, also not sure if $i should be equal 1 or 2.
      Help will be appreciated.
    • FMS
      By FMS
      Hello,
      I'm trying to get data from twitter to an array and so far I found an Twitter UDF whish lookes very intresting but couldn't get it to work.
      It lookes not supported any more(2010) and buggy when i read all te replies.
      More around this subject (autoit and twitter) i couldn't find on this forum.
      Is there sombody who know's a good way to get live data from twitter to an array inside autoit?
      (I kinda doubt that this isn't tackled before)
      In the end I was hoping to get all tweets from date to date from an specific subject inside a 2D array to work whit.
    • AndreasNWWWWW
      By AndreasNWWWWW
      I got a question:  i am trying to run different functions based upon what i select in these radio buttons.(code below)
      it needs to check server 1. then run function 1 or function 2 after what i selected in the checkbox.
      once that function is done it moves to the next one, until it has been trough all 5 
       
      iv'e tried using while loops with different while $i equals to something but then i manualy need to go in and edit the script every time.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Server2 = GUICtrlCreateLabel("Server2", 216, 95, 41, 17) $server1 = GUICtrlCreateLabel("Server1", 216, 72, 41, 17) $server4 = GUICtrlCreateLabel("Server4", 216, 144, 41, 17) $server3 = GUICtrlCreateLabel("Server3", 216, 119, 41, 17) $server5 = GUICtrlCreateLabel("Server5", 216, 170, 41, 17) $Start = GUICtrlCreateButton("Start", 240, 248, 147, 25) $Checkbox1 = GUICtrlCreateCheckbox("function1", 288, 72, 97, 17) $Checkbox2 = GUICtrlCreateCheckbox("function2", 392, 72, 97, 17) $Checkbox3 = GUICtrlCreateCheckbox("function1", 288, 96, 97, 17) $Checkbox4 = GUICtrlCreateCheckbox("function2", 392, 96, 97, 17) $Checkbox5 = GUICtrlCreateCheckbox("function1", 288, 120, 97, 17) $Checkbox6 = GUICtrlCreateCheckbox("function2", 392, 120, 97, 17) $Checkbox7 = GUICtrlCreateCheckbox("function1", 288, 144, 97, 17) $Checkbox8 = GUICtrlCreateCheckbox("function2", 392, 144, 97, 17) $Checkbox9 = GUICtrlCreateCheckbox("function1", 288, 170, 97, 17) $Checkbox10 = GUICtrlCreateCheckbox("function2", 392, 170, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd  
    • FroVN
      By FroVN
      i have a text : <Name>Jonh</Name>.<Age>15</Age>
      how i can get Jonh and 15 in one stringregexp? pls give me example
    • 31290
      By 31290
      Hi everyone, 
      I'm currently writing a script that allow me to list all currently installed software on a computer but some of the are listed in the HKLM64 hive of the registry whereas 95% of all others are in the HKLM "normal" one.
      Thing is, I'd like to combine these two reg key into one single ListView item.
      Here's my code so far, knowing that it's working on both cases (changing to HKLM64 or HKLM short)
      Thanks in advance for the help
      -31290-
×