GrungeRocker Posted April 7, 2009 Share Posted April 7, 2009 Hi.I need to varify a string. So I just want to check, if the string uses valid characters.Allowed characters are:*_LNn"any text with numbers in it"'any text with numbers in it'I tried it with$validpattern = '[*_LNn]"(.*?)"' $validpattern = $validpattern & "'(.*?)'"but that does not work.I really don't get those expressions....May someone help me? [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
system24 Posted April 7, 2009 Share Posted April 7, 2009 (edited) Let me test... [Can't test here. AutoIt's broken.] $validpattern = '([0-9][*_LNn])' Edited April 7, 2009 by system24 [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center] Link to comment Share on other sites More sharing options...
GrungeRocker Posted April 7, 2009 Author Share Posted April 7, 2009 The Text is only allowed to be in " " and ' ' [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Izebize Posted April 7, 2009 Share Posted April 7, 2009 Try this: $validpattern = '(?:[*_LNn]|"(.*?)"' $validpattern &= "|'(.*?)')" Link to comment Share on other sites More sharing options...
GrungeRocker Posted April 7, 2009 Author Share Posted April 7, 2009 (edited) No =( _*_N*"text"" Seems valid to it, but the last " is not closed =(( Edited April 7, 2009 by GrungeRocker [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
GrungeRocker Posted April 8, 2009 Author Share Posted April 8, 2009 *push* Please help... [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Authenticity Posted April 8, 2009 Share Posted April 8, 2009 (edited) Dim $sStr = "L'abcdefghijklmnopqrstuvwxyz1234567890'" Dim $sPatt = "([_nNL*](['""])([^\2]*)\2)" Dim $aMatch = StringRegExp($sStr, $sPatt, 1) ConsoleWrite(@error & @TAB & @extended & @LF) If IsArray($aMatch) Then For $i = 0 To UBound($aMatch)-1 ConsoleWrite($aMatch[$i] & @LF) Next EndIf Edited April 8, 2009 by Authenticity Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now