In every programming language I have worked with, regular expression support (if one exists) is basically a black box: there are some functions, such as match , scan , etc. that take an expression and return that often a string or an array, but they donβt report what they do when they do it.
I am wondering if any reasonably popular programming language has built-in or library support for matching regular expressions and providing some kind of real-time output (for example, for standard output) that indicates what is happening.
Update : I appreciate comments so far; however, I am not asking about a tool that displays the structure of the regular expression itself, which debuggex.com and regexper.com seem to do (although it is very cool!). I wanted to ask about providing information during the part where the expression applies to some input.
Here is a hypothetical example: suppose I had the expression "(foo | bar | baz)" and I check this against the string "baz"; then I present a conclusion that may look like ...
testing "foo" - nope testing "bar" - nope testing "baz" - found match
Obviously, this would have looked completely different; but you get this idea.
regex
Dan tao
source share