Consider a sample example as below:
String string = "Hi$?Hello$?". In the string object the "$?" is the regex pattern. The first occurrence of the $? has to replaced with "there" and second occurrence of the $? has to replaced with "world".
How to implement the same using Java? or Is there any methods available in Apache commons StringUtils to implement the same?