Page 1 of 1

Dynamic Function Tester (Preview RegEx)

Posted: 04 Oct 2013, 07:11
by Pulover
Test & Preview Functions

I made this mostly to help me test RegExMatch & RegExReplace and see the results before using them in my scripts, but it works with other built-in functions as well and you can add your own using #Include.

Image

Features:
  • Displays parameters and default values.
  • Updates Result on-the-fly.
  • Displays function already formated to be used in scripts.
  • You can #Include user-defined functions (you can add the syntax to list in the beginning of the script).
  • Use Expressions & Functions in the parameters*.
* For this you'll need an additional function to evaluate expressions in strings. Save the file to the same folder, then you just have to type the name of the function in the beginning of this script (ExpFunc := "FunctionName") and #Include the name of the file at the bottom. When this option is enabled quotes are required around strings.
This feature is tested to work with:
Note: If you choose to use Fincs' version you'll have to remove the MsgBox from line 36 in his script to avoid error messages while typing the parameters.

** Not all functions in the list will work but I keep them for reference only.
DynamicFunctionTester.ahk
:arrow: Download from GitHub (Right-Click > Save As)
Spoiler

Re: Dynamic Function Tester (Preview RegEx)

Posted: 13 Oct 2013, 05:57
by Guest10
so does this allow testing of ANY & ALL Regular Expressions?

Re: Dynamic Function Tester (Preview RegEx)

Posted: 13 Oct 2013, 10:20
by Pulover
Well, possibly yes. I've been using it for a long time and can't remember any situation where it will fail. I use it to test regular expressions even in other programming languages.

Re: Dynamic Function Tester (Preview RegEx)

Posted: 13 Oct 2013, 11:10
by tank
Pulover I have been a programmer professionally for better than 10 years much longer before that. I have untill 3 years ago managed to avoid regex. I imagine newbies as well as people like me would benefit from a library function to store commonly used expressions with a description. Similarly some of the more common ones as well. phone email html etc
finally a link to some good web tutorial on regex. Sinkfaze wrote a very nice on in the old forum. honestly i refer to it alot now

Re: Dynamic Function Tester (Preview RegEx)

Posted: 13 Oct 2013, 11:15
by Guest10
where the link to Sinkfaze's tutorial? thanks!

Re: Dynamic Function Tester (Preview RegEx)

Posted: 13 Oct 2013, 11:47
by tank

Re: Dynamic Function Tester (Preview RegEx)

Posted: 14 Oct 2013, 05:31
by Pulover
Tank, I have actually learned RegEx from Sinkfaze's tutorial too. Like most everyone I've found regex complex at first, but today I can say that many of the things I did in my scripts would have been very difficult to achieve without it.

I'm interesting in working on this function to simplify or teach regex in an easier way. Could you elaborate more on your idea? Would be something like calling a function with a parameter like "phone" or "span" to match pre-made expressions? Or would it be more beneficial a graphic program to write expressions with human readable options like "numbers", "letters", "any character", "match at the beginning", etc...?

Re: Dynamic Function Tester (Preview RegEx)

Posted: 14 Oct 2013, 07:34
by Guest10
does it mean i can go from zero to hero by reading Sinkfaze's tutorial ONLY? i have already copied those 3 pages of tutorial and saved them in portable PDF files for convenience. :lol: