Sign in to follow this  
Followers 0
CyberSlug

StringRegExp help

4 posts in this topic

#1 ·  Posted (edited)

I'm not getting something about StringRegEXP flag values....

$result = StringRegExp("aeiou", "[a-z]", 3 )

MsgBox(0x1000, "extended", @extended)
MsgBox(0x1000, "isArray", IsArray($result))

I thought that if @Extended is true (1), then $result should be an array....

Tried AutoIt 3.1.1.113 and 3.1.1.125 on WinXP Pro sp2

Edit: corrected AutoIt version info

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites



looks like a contradiction between the documentation for the flag and extended

3 Perform a global search, checking the entire string, returning an array of all results. Check @Extended to determine whether the pattern matched or not.

1 (true) Match found. Return value is an array of all group values. If there are no groups in the pattern, the function returns "" (empty string).


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I'm not getting something about StringRegEXP flag values....

$result = StringRegExp("aeiou", "[a-z]", 3 )

MsgBox(0x1000, "extended", @extended)
MsgBox(0x1000, "isArray", IsArray($result))

I thought that if @Extended is true (1), then $result should be an array....

Tried AutoIt 3.1.1.133 and 3.1.1.125 on WinXP Pro sp2

(1) shows a wrong flag when the expression is written incorrectly I believe
$result = StringRegExp("aeiou", "([a-z])", 3 )
If @extended And IsArray($result) Then
    For $i = 0 To UBound($result) - 1
        MsgBox(64, 'Info:', $result[$i])
    Next
EndIf

Edit:

Gary's second quote was what I was getting at, that's what I meant other than "incorrectly".

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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