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

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -