in reply to Getting characters from regex pattern
prints:perl -le '@a=qw/capri cApRi TITLE-case/; for(@a){s/(\pL+)/ucfirst(lc $ +1)/ge; print}'
(The "\pL+" in the regex matches all "letter" characters; if your data tends to involve content in languages with non-Latin, non-cased letters, you'll probably want to use "\p{LC}" or "\p{CasedLetter}+" instead.)Capri Capri Title-Case
|
|---|