Popular Post Szhlopp Posted September 3, 2008 Popular Post Share Posted September 3, 2008 (edited) Since there are WAY to many posts on how to SRE something I thought I would create a nice little tester. This thing does SRE and SRER.Loads files to test.Gets internet content to test.And more!Here it is:SRETesterV2.1.au3Prev DL - 211Enjoy! Edited October 10, 2008 by Szhlopp jvanegmond, roderickdvi, wilburnwlssh and 8 others 11 RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Szhlopp Posted September 4, 2008 Author Share Posted September 4, 2008 Since there are WAY to many posts on how to SRE something I thought I would create a nice little tester. This thing does SRE and SRER. Loads files to test. Gets internet content to test. And more! Here it is: Prev DL - 14 Enjoy! Quick update: Fixed a few bugs. Added "Notes" tab Added "AutoIt" tab. And thanks for the rate! (Whoever did it) dewittcfez and jewelluoc 2 RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
gseller Posted September 4, 2008 Share Posted September 4, 2008 Sweet!! Now if you can release that bot that will come cram REGEX into my brain!! LOL I just don't get it... I can't pull myself out of a wet paper bag using regex... LOL Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 4, 2008 Share Posted September 4, 2008 RegEx isn't that hard to learn. Give yourself 1 hour reading and trying and you can do it. Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Szhlopp Posted September 4, 2008 Author Share Posted September 4, 2008 Sweet!! Now if you can release that bot that will come cram REGEX into my brain!! LOL I just don't get it... I can't pull myself out of a wet paper bag using regex... LOL Funny you mention it...I actually was thinknig about writing a 'bot'.You supply it the text:<Xml>Hey</xml>Highlight it:<Xml>Hey</xml>Press the button and you get some options on how it should be formatted.The problem is, there are alot of options on some pieces of text. Does it look for:<xml>(.*?)<>(.*?)<<(?:.*?)>(.*?)<<(?:.*?)>(.*?)</>(.*?)</...ect...As you can see with a very simple string there are a lot of different ways to do it. You would have to have some way programmatically to get the result down. Either by supplying it like 5 cases or just testing it with all the results and then testing the list of patterns again with another case. My only other idea was this. Have a button someplace on the GUI that has a nice list of the commands (Currently 'help!'). The commands you could just double click/insert and every command would have an example of how/why it works. This way would teach the user more than just using the process of elimination. Still don't know if it would be worth all the time in doing... RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
gseller Posted September 4, 2008 Share Posted September 4, 2008 I am sure I would use it often! @ Xenobiologist - I have tried, it just does not make sense past the simple examples. For now, I am destined to beg for regex help on the forum.. LOL Link to comment Share on other sites More sharing options...
ResNullius Posted September 5, 2008 Share Posted September 5, 2008 Funny you mention it...I actually was thinknig about writing a 'bot'.You supply it the text:<Xml>Hey</xml>Highlight it:<Xml>Hey</xml>Press the button and you get some options on how it should be formatted.Sounds a little like "Regulazy": http://weblogs.asp.net/rosherove/pages/too...y-osherove.aspx Link to comment Share on other sites More sharing options...
gseller Posted September 5, 2008 Share Posted September 5, 2008 Sounds a little like "Regulazy": http://weblogs.asp.net/rosherove/pages/too...y-osherove.aspxI downloaded it and will have to sit down with it.. Thanks.. Still waiting for Szhlopp's BOT.. LOL Link to comment Share on other sites More sharing options...
Szhlopp Posted September 5, 2008 Author Share Posted September 5, 2008 I downloaded it and will have to sit down with it.. Thanks.. Still waiting for Szhlopp's BOT.. LOL Meh, that isn't close to the top of my list... May mess with it a little after I put 4.2 out of the olympcs. RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
JRowe Posted September 8, 2008 Share Posted September 8, 2008 Is there any way to add highlighting of matched terms in the text/file view? Thank you very much, btw, it's saving me a ton of work formatting data for a database [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
Szhlopp Posted September 8, 2008 Author Share Posted September 8, 2008 Is there any way to add highlighting of matched terms in the text/file view?Thank you very much, btw, it's saving me a ton of work formatting data for a database Welcome.Highlighting the text found in the text/file tabs?HeyTest1 more wordPattern: more'more' lights up?Interesting... Yeah I might be able to do something like that with a re-work and a good RTF UDF. I may look into this=) RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Szhlopp Posted October 10, 2008 Author Share Posted October 10, 2008 Quick update on the SRE tester. Added control tips to the radio's. Fixed an issue with the "Text" tab having a very small limit(Now 1000000). Added a comment line inside the script to thank w0uter for the original GUI layout. RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Garp99HasSpoken Posted October 24, 2008 Share Posted October 24, 2008 CONDITIONAL SUBPATTERNS It is possible to cause the matching process to obey a subpattern conditionally or to choose between two alternative subpatterns, depending on the result of an assertion, or whether a previous capturingsubpattern matched or not. The two possible forms of conditional subpattern are (?(condition)yes-pattern) or (?(condition)yes-pattern|no-pattern) If the condition is satisfied, the yes-pattern is used; otherwise the no-pattern (if present) is used. If there are more than two alternatives in the subpattern, a compile-time error occurs. I was trying this out with your program but could not get anything working. Is it your program that ignores this or is it AutoIt which does not implement this part of regexp? Sample input 11:34:26 and 6:48:32 where I want the second to have the 6 zero filled and the seconds removed From (\d)?(\d):(\d)?(\d):\d\d to (?(1)\1|0)\2:(?(3)\3|0)\4 output is (?(1)1|0)1:(?(3)3|0)4 (?(1)|0)6:(?(3)4|0)8 but should be 11:34 06:48 Link to comment Share on other sites More sharing options...
Szhlopp Posted October 24, 2008 Author Share Posted October 24, 2008 I was trying this out with your program but could not get anything working. Is it your program that ignores this or is it AutoIt which does not implement this part of regexp? Sample input 11:34:26 and 6:48:32 where I want the second to have the 6 zero filled and the seconds removed From (\d)?(\d):(\d)?(\d):\d\d to (?(1)\1|0)\2:(?(3)\3|0)\4 output is (?(1)1|0)1:(?(3)3|0)4 (?(1)|0)6:(?(3)4|0)8 but should be 11:34 06:48 Uhm, I have no idea what you're asking.... All my program does is add a GUI to the AutoIt function "StringRegEx". The version of AutoIt you're using is also the version my script uses(unless you compile it). Conditional Subpatterns work like this: Text: Hello You Hello Me Hello Myself Flag: 3 Pattern: (?i)Hello\s?(?:You|Me) (?i) Insensitive flag "Hello" - Text to find \s? - Space may or may not appear (?: - Non capturing group You|Me - Finds either "You" or "Me" ) - End group Help explain? RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
Garp99HasSpoken Posted October 27, 2008 Share Posted October 27, 2008 Uhm, I have no idea what you're asking....If Conditional subpatterns are NOT supported by AutoIt or just your program.I guess it's AutoIt... or my understanding on how to use them.Your example had nothing to do with Conditional subpatterns.Help explain?I thought I did! Link to comment Share on other sites More sharing options...
GEOSoft Posted October 27, 2008 Share Posted October 27, 2008 "(\d*:\d*):" George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
zerobazar Posted October 28, 2008 Share Posted October 28, 2008 Garp99HasSpoken, AutoIT is using PCRE engine for regex.PCRE is supporting/implementing conditional subpatterns so there should not be any problem to use them with AutoIT.But coming back to the GUI proposed by Szhlopp, what it does, is to give you an easy way to test regex without coding script (a bit like RegexBuddy). It helps you to test one regex at time.Now coming back to your example, I do not understand how it can achieve what you expect in one regex? Can you explain how you would use it within one regex (only)?I'm quite new at these regex, but willing to learn.Thanks.Best regards. Link to comment Share on other sites More sharing options...
GEOSoft Posted October 28, 2008 Share Posted October 28, 2008 (edited) Garp99HasSpoken, AutoIT is using PCRE engine for regex. PCRE is supporting/implementing conditional subpatterns so there should not be any problem to use them with AutoIT. But coming back to the GUI proposed by Szhlopp, what it does, is to give you an easy way to test regex without coding script (a bit like RegexBuddy). It helps you to test one regex at time. Now coming back to your example, I do not understand how it can achieve what you expect in one regex? Can you explain how you would use it within one regex (only)? I'm quite new at these regex, but willing to learn. Thanks. Best regards.With what he was doing there was no need for a conditional so I just gave him the RegExp in my reply. What that says is; get a digit 0 or more times then the colon then digits 0 or more times again and stop at the next colon. Since none of the characters can be case sensitive I didn't need (?i). It could also heve been written as (?i)(\d*[h:]\d*): which would also allow for those people who have an h as the Hr/Min separator instead of a colon. If it was being used in a StringRegExpReplace situation I would probably use something like (\d*):|h(\d*) as in $sStr = StringRegExpReplace($sStr, "(\d*):|h(\d*)", "\1:\2") Which would also make sure that the return was 06:48. (Group 1 and colon and group 2) Edited October 28, 2008 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
zerobazar Posted October 28, 2008 Share Posted October 28, 2008 GEOSoft,I can not make to work any of the example you provide...Based on your first proposal, some thing like:$sStr = StringRegExpReplace($sStr, "(\d*:\d*)(:.*)", "\1")would be closer (to remove seconds), but is still missing the requirement to have a zero filled at the beginning when you have 6:48:32->06:48In fact, the first regex(\d)?(\d):(\d)?(\d):\d\dGarp99HasSpoken was suggesting is ok to match expressions like 11:34:26 and 6:48:32 but that's the second part I would like to understand...To work it would need to be "run" within the same regex expression (because there are backreferences to group 1,2,3 and 4) but I feel there is a problem with the use of conditional in this case (at least in the way I understand them).Best regards. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 28, 2008 Moderators Share Posted October 28, 2008 GEOSoft, I can not make to work any of the example you provide... Based on your first proposal, some thing like: $sStr = StringRegExpReplace($sStr, "(\d*:\d*)(:.*)", "\1") would be closer (to remove seconds), but is still missing the requirement to have a zero filled at the beginning when you have 6:48:32->06:48The simple explanation for 1 expression is .... you can't. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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