Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要编写一个简单的正则表达式来帮助我检查字符串是否以字符 '23' 开头。如果它以这个字符串开头,那没关系,如果不是,我会放弃它。
我试图实现以下正则表达式,但我认为它并不完美。(^23)
你有什么建议吗?
非常感谢!
是的,您认为的命令可以正常工作。grep ^23 file可以:
grep ^23 file
$ cat a 23aaa aa23 aaa $ grep ^23 a 23aaa