Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: back translating regular expressions

by Anonymous Monk
on Mar 03, 2005 at 10:05 UTC ( #436135=note: print w/ replies, xml ) Need Help??


in reply to Re^2: back translating regular expressions
in thread back translating regular expressions

/a/
does not contain a quantifier, but there are an infinite amount of strings it will match. And if you only want to consider anchored strings:
my $q1; $q1 = qr /a(??{$q1})?/; my $q2 = qr /^$q1$/;
matches all strings containing nothing but a's. But it doesn't use any of the quantifiers you mentioned.

Also,

/^(?!)*$/
contains a * quantifier, but it doesn't actually match any string. Perhaps you want to discount lookahead. Then I give you:
/^(|)*$/
It'll give a warning, but all it matches is the empty string. But it does have a * quantifier.


Comment on Re^3: back translating regular expressions
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-05 23:58 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 (68 votes), past polls