Perl Monk, Perl Meditation | |
PerlMonks |
Re: Generalizing a REGEXby haukex (Archbishop) |
on Aug 08, 2020 at 19:02 UTC ( [id://11120504]=note: print w/replies, xml ) | Need Help?? |
You can anchor the regex to the end of the string with $. See perlrequick, perlretut, and perlre. Note the /r modifier I'm using is only available in Perl 5.14 (from 2011) and up.
Update: See also Re: How to ask better questions using Test::More and sample data
In Section
Seekers of Perl Wisdom
|
|