Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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.


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?


        Do you think I should do away with it?


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://979787]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2018-06-24 10:05 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.