Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2016-10-25 08:46 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.