string - Efficicient way for Java pattern Matching -
what best , fastest way check if string matches like:"ab+space+number+anything eg: "ab 1234 defg" looking efficient way, going compare thousands of transaction per minute.
use string.matches function uses regex string matching.
string.matches("ab \\d+.*"); ^ ^ ^ ^ | | | |_ ab | num | space if want space after number, use
"ab \\d+ .+"
Comments
Post a Comment