What is Java Regex to match number then space then 3 alphabet char? -


i want validate of money currency unit.

 100 usd : valid 1.11 usd : not valid 1,12 usd : not valid 12 : not valid 

so valid string "the number space 3 alphabet char".

text.matches("^\\d+ [a-za-z]{3}*$") 

i got error: exception caught: dangling meta character '*' near index 16 ^\d+ [a-za-z]{3}*$

so how fix it?

i fixed obmitting * fine:

text.matches("^\\d+ [a-za-z]{3}$") 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -