in reply to How to use \l and \u in regex mathing patterns?
see perlre: \l lowercase next char$ perl -e '$b="H";( $a = "hello" ) =~ s/^\l$b/Y/; print $a' Yello
So, after interpolation, "\l$b" gives "\lH" ie "h" and you obtain s/h/Y/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to use \l and \u in regex mathing patterns?
by Anonymous Monk on May 09, 2012 at 16:54 UTC | |
by AnomalousMonk (Archbishop) on May 09, 2012 at 17:06 UTC | |
by Anonymous Monk on May 09, 2012 at 17:18 UTC | |
by JavaFan (Canon) on May 09, 2012 at 18:26 UTC |