in reply to search/replace one liners without clobbering
Are you looking to strip the c off the front and the f or l off the back?
perl -e '$tgt =~ s/\bc?(\w+?)(?:f|l)?\b/$1/g;'Feed the target token into it to strip off leading c and trailing f or l. Of course, this would make a bool into a boo.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: search/replace one liners without clobbering
by f77coder (Beadle) on Feb 26, 2016 at 02:04 UTC | |
by FreeBeerReekingMonk (Deacon) on Feb 26, 2016 at 21:38 UTC |