I’m developing an app to read QR code via ZXing. The code run flawlessly but i’m having problem meddling with the scanned result because i wanted to change certain word from it. consider the scanned result is this:
ID: 1001 Detail: RM9999
what should i do if i wanted to change the “9999” in the string above with another string? lets say it is
String a1 = 1500
so the expected outcome would be
ID: 1001 Detail: RM1500
edited:
@Bohemian So the actual problem is my QR code actually display like this:
ID: 1001
Detail: RM9999
instead of the linear line that i show earlier. any workaround for this?
You can use lookbehind:
Which means replace all occurrences of “9999” preceded by “: RM” with “1500”.
Edit, to answer comments, you can do:
Note that I used
Pattern.quoteto escape any regular expression effect from it.