dbzfanatic Posted August 29, 2008 Share Posted August 29, 2008 I've never really used StringRegExp before but I need to use it to check to see if something is in a string. Here's an example of the pattern &sid=7e2ee2f398cb83c699e476725877992e How would I make a pattern for this? I need to remove that from the string returned so I can save it as a normal url and since I know SID are temporary (session id) if that were saved as a url it wouldn't work after the time specified on the board had passed. Can anyone help me? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 29, 2008 Share Posted August 29, 2008 I've never really used StringRegExp before but I need to use it to check to see if something is in a string. Here's an example of the pattern &sid=7e2ee2f398cb83c699e476725877992e How would I make a pattern for this? I need to remove that from the string returned so I can save it as a normal url and since I know SID are temporary (session id) if that were saved as a url it wouldn't work after the time specified on the board had passed. Can anyone help me? Try this: Global $sString = "Stuff1234567890MoreStuff&sid=7e2ee2f398cb83c699e476725877992eYetMoreStuff" Global $avString = StringRegExp($sString, "\&sid=[[:xdigit:]]+", 1) MsgBox(64, "Result", $avString[0]) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Zinthose Posted August 29, 2008 Share Posted August 29, 2008 (edited) This one dose the trick and will return an array of all the values of the matches found. Dim $String = "&sid=7e2ee2f398cb83c699e476725877992e" Dim $Pattern = "(?i)&sid=((?:\d|[A-F]){32})" Dim $Matches = StringRegExp($String, $Pattern, 3) For $i = 0 to UBound($Matches) - 1 MsgBox(4096, "RegEx Result", $Matches[$i]) NextoÝ÷ Úȳz,¥©ì·)^ Edited August 29, 2008 by Zinthose --- TTFN Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 29, 2008 Author Share Posted August 29, 2008 Thanks guys, really helps. Thanks for explaining how your pattern worked too Zinthose, gave me a bit more insight into how the function works so thank you very much. Testing them now so I'll edit the post when I have results. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] 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