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 ( #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? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2022-12-01 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?