Is there any implementation of regex that allow to replace group in regex with lowercase version of it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Perl, you can do:
The
/eoption causes the replacement expression to be interpreted as Perl code to be evaluated, whose return value is used as the final replacement value.lc($x)returns the lowercased version of$x. (Not sure but I assumelc()will handle international characters correctly in recent Perl versions.)/gmeans match globally. Omit thegif you only want a single replacement.