开发者

Regular expression - match letters and punctuation [closed]

开发者 https://www.devze.com 2023-02-17 01:55 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

Improve this question
if (!Pattern.matches("pattern",(input.getText().toString())))

I want to check pattern for input and my input can have ".", "/", space, and A to z like these cases:

  • ...Atoz
  • Atoz....
  • Atoz...Atoz
  • Atoz/Atoz

What should I do with 开发者_开发技巧my "pattern"?


in your last example there is a slash (/) , what's it's implication?

otherwise: [A-Za-z.]+ should to it , it will work if there is only A-z and . (dot) characters .

0

精彩评论

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