Friday, 15 August 2014

regex - Java regular expression for a digit followed by z^3? -



regex - Java regular expression for a digit followed by z^3? -

i want check if string matches form az^3 integer. i've tried following:

str.matches("\\d* z^3") str.matches("\\d* z\^3") str.matches("^(\\d* z^3)$") str.matches("^(\\d* z\^3)$") str.matches("\\d* (z^3)") str.matches("\\d* (z\^3)")

this driving me crazy. :-( i've tried every possible regex tutorial , searched examples , still can't come solution.

i'd appreciate if can help me.

you need escape backslash in java

str.matches("\\d+z\\^3");

java regex

No comments:

Post a Comment