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

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -