Jump to content

Recommended Posts

Posted (edited)

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
Posted

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
Posted

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.

  • Administrators
Posted

PLease post a bug report in the other forum, if Nutster is anything like me when busy he will just skim read the general support threads.


 

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
×
×
  • Create New...