Java String/Regex Replace -
i'm quite new regex. not sure how follow:
replace ":p_id" specific value.
for example when want replace ":p_id1" value, replaced ":p_id10" same value not want.
it's possible ":p_id"'s have punctuation before or after them e.g. "=:p_id1)"
any advice?
use \b (word boundary) operator
mystring.replaceall(":p_id1\\b","some replacement"); see pattern > boundary matchers
Comments
Post a Comment