lostbit Posted June 24, 2009 Share Posted June 24, 2009 Yah it's me again, OK I have a script that reads from a gui a line of text; sometimes the tesxt is not what I need, i.e. http/www something. I only want the string when it does not have this format. The text changes sort of like adds. I have looked at some of the examples but I do not get the aproach. I need to get the string, evaluate the string if contains unwanted text, get string again, max retry count so it does not loop. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 24, 2009 Share Posted June 24, 2009 Please give me a list of example lines and say good or bad on them so I can fully understand what it is you need or don't need. Link to comment Share on other sites More sharing options...
BrettF Posted June 24, 2009 Share Posted June 24, 2009 Maybe... $url1 = "http/google.com" $url2 = "http://www.google.com" MsgBox (0, "", _IsValid($url1)) MsgBox (0, "", _IsValid($url2)) ;Returns 1 for valid, 0 for invalid. Func _IsValid ($url) Return StringRegExp ($url, "(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?") EndFunc Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Darktan Posted June 24, 2009 Share Posted June 24, 2009 I believe StringInSr is what you want. StringInStr -------------------------------------------------------------------------------- Checks if a string contains a given substring. StringInStr ( "string", "substring" [, casesense [, occurrence [, start [, count]]]] ) 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