开发者

regex to remove all formatting

开发者 https://www.devze.com 2023-02-17 17:26 出处:网络
I\'m looking for a regex to remove everything except letters from a string. E.g. \"Marys Page ....\" should b开发者_如何学JAVAecome \"MarysPage\"The one that would be passed to tools like perl/sed/e

I'm looking for a regex to remove everything except letters from a string.

E.g. "Marys Page ...." should b开发者_如何学JAVAecome "MarysPage"


The one that would be passed to tools like perl/sed/etc would be: s/[^a-zA-Z]//g


You can replace [^a-zA-Z] with "".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号