I’m parsing a text file and I need to remove all terms such this:
upcoming:event=103499
abc:dfe=123813
...
Format: `term1:term=0000000`
I’m currently using this reg expression to remove such terms from my text file:
myString = myString.replaceAll("[0-9A-Za-z]+:[0-9A-Za-z]+", "");
So for example, if I have a string like this:
"blabla abc:dfe=123813 cococo ghi:pol=09339 pppoooo"
it should become: "blabla cococo pppoooo"
But it doesn’t work
thanks
You need to assign the return value of
replaceAllback to the string reference:And it works
But if you want to replace the entire string you can do:
EDIT:
For the edited question you can use:
See it