[英]Is there a perl equivalent to sed's or vim's `\l` and `\u` in substituting?
in sed(1)
& vim(1)
, there are a set of 'operators' in the regex substitution syntax, \\u\u003c/code> ,
\\l
, \\U
, & \\L
. 在
sed(1)
和vim(1)
,正则表达式替换语法中有一组'operators', \\u\u003c/code> ,
\\l
, \\U
和\\L
These translit characters to either lowercase, or uppercase. 这些字符转换为小写或大写。 So if one were to type
s/(*.)/\\L\\1/g
, it would translit the entire string to lowercase, theoretically. 因此,如果要键入s/(*.)/\\L\\1/g
,理论上它将把整个字符串转换为小写。
Is there equivalent functionality in Perl? Perl中是否有等效的功能? Is something or eqivalent like... 是类似的东西...
while(<>) {
s/(*.)/\L\1/g;
}
vaild? 可以吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.