Jump to content

RegExp issue(s)


Recommended Posts

Oh believe me, I did. And once you get a replace function working for RegEx's I'll be very happy. I wish PHP had implemented this type of functionality in their regex's. I have to do patterns like "\[b\][^\[]+\[/b\]" to do something like what your pattern does with this "\[b\].+?\[/b\]".

Edited by Saunders
Link to comment
Share on other sites

I have a list of invalid chars and it should not match them.

These are the chars:

/ < > ? [ ]: | *

Why does the following fail?

$sFolder = "\Program Files\AutoIt3"
StringRegExp($sFolder, '[^/<>\?\[\]:|\*]{' & StringLen($sFolder) & '}')
If @Extended Then
   MsgBox(64, "Test", "Successful!")
Else
   MsgBox(64, "Test", "Failure!")
EndIf
Link to comment
Share on other sites

As near as I can figure out, the pattern isn't escapeing the closebracket you have, so it's not working properly. Cus if you change the pattern to take out the \] it returns fine.

$sFolder = "\Program Files\AutoIt3"
StringRegExp($sFolder, '[^/<>\?\[:|\*]{' & StringLen($sFolder) & '}')
If @Extended Then
   MsgBox(64, "Test", "Successful!")
Else
   MsgBox(64, "Test", "Failure!")
EndIf

Another bug I guess.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...