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

Re: Basic Regular expression

by NetWallah (Canon)
on Feb 09, 2017 at 17:29 UTC ( [id://1181553]=note: print w/replies, xml ) Need Help??


in reply to Basic Regular expression

You can achieve your desired output by using this re:
$a =~/^(.+)(e|r)?(.*)$/;
Update: Just noticed - this is almost the same as choroba's suggestion.

        ...it is unhealthy to remain near things that are in the process of blowing up.     man page for WARP, by Larry Wall

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found