我正在使用正则表达式为一个文本框编写输入验证器,我只想要字母字符.我在想,如果[A-z]和[a-zA-Z]是相等的或是否存在差异明智的性能.
我继续阅读[a-zA-Z]我的搜索,没有提到[A-z].
我正在使用java的String.matches(regex).
我有兴趣看看是否可以创建这样的正则表达式?例如,这个正则表达式将恰好匹配前面的两个标记:^((pi|e|x|([-]?[0-9]*[.]?[0-9]+)){2}),并且只要它里面有两个或多个内容,我就想匹配这样的字符串。
//want to recognize
//piex14.3 -- will see pi, e, x, number of type double
//14e -- will see number of type double, e
//12.5pi -- will see number of type double, pi
//ex -- will see e, x
Run Code Online (Sandbox Code Playgroud)