Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: The Perl Regex Tester

by davido (Archbishop)
on Jul 03, 2012 at 20:56 UTC ( #979787=note: print w/ replies, xml ) Need Help??


in reply to Re: The Perl Regex Tester
in thread The Perl Regex Tester

I've read MJD's paper on Using (?{print}) for debugging, but it seems imprudent to enable use re qw(eval) in the context of executing user regexes. Since I'm not certain that I could sanitize the regex well enough to feel good about re 'eval', I'll have to pass on that technique.

That Tk snippet was interesting. As for Re: validate a form field with regexp?, I could see allowing someone to use English to enter a regex, and then see what it looks like in "indistinguishable from line noise" format. I'll give that some thought.

I thought my code prevented zero-length regexes, but not zero-length targets. I'll look into it and get that fixed. In fact, I should probably allow zero-length regexes too, but (?:) is essentially the same thing.

Thanks for your input.

Update:After looking at Your failed match, I am not sure that there's an issue. It seems to be correctly stating "No Match!", as (\b\w+) shouldn't match against an empty string. I could be misunderstanding.

The linking feature was an afterthought, and I'm already glad I added it. I see that as being useful.


Dave


Comment on Re^2: The Perl Regex Tester
Select or Download Code
Replies are listed 'Best First'.
Re^3: The Perl Regex Tester
by Anonymous Monk on Jul 03, 2012 at 21:17 UTC

    I could be misunderstanding.

    When I with my eyes look at the form it says "Target string", sure its a little greyed out, I expected the regex I typed to match against "Target string" not empty string :)

      Oh, I see. ...yes, that's an HTML5 placeholder. Do you think I should do away with it?


      Dave

        Do you think I should do away with it?

        Yes.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://979787]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2015-07-08 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls