I'm trying to replace the second closing tag > in an String Something="<!-- comm --!><tag titi="string1" toto="string2">" using regex in java.
Something.replaceFirst( "^?>","XXXX")
replace the first >
I would like to replace the second closing tag > after string2 to have this result
Something="<!-- comm --!><tag titi="string1" toto="string2"XXXX"
I'm not really familiar with regex. What am I must doing? Thanks
>instances, and then splice the string. Regex can only help you a little bit with this! It looks like you're hacking some html. Maybe use a tool like jsoup which is built to do this?