Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: regexp with mismatches

by JavaFan (Canon)
on Mar 25, 2012 at 16:33 UTC ( [id://961506]=note: print w/replies, xml ) Need Help??


in reply to regexp with mismatches

For the first question, use:
/ABC(?:DD.|D.D|.DD).E/; # Add /s if newline is acceptable near the +Ds

As for the generic case, you don't. Regexes aren't suitable for that. For particular cases, you may be able to get away with listing all possibilities, or by using (?{...}), but in a general case, you'd be using the wrong tool.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-03-28 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found