Wednesday 16 November 2011

Pattern & Matcher in Java

// All values equals to "0,00" but not those 
// which have "0,00" as a part, like "20,00"
final Pattern pattern = Pattern.compile( "\\D*?0,00" );
final Matcher matcher = pattern.matcher( values );
if ( matcher.matches() ) {
      // ... 
}
For more details see this page.

No comments: