A regular expression is used to parse text that include '=' and put split string into a stringlist like key value pair.
But if value contains '=', it can not use list.add(key3+'='+'number=10');
key1 this's done
key2 that costs 10 dollars
key3 number=10 // invalid data, error prompt.
...
how to solve? Thank you.
Edit:
Thank you all for help.
If I have to add a string that includes '=' into key, how can I solve it?
for example, the text to be parsed may be like this:
maleConsumer=john 1
maleConsumer=eric 2
femaleConsumer=mary 2
maleConsumer=john 8
...
I use regex reg='\b\S+\b' parse text and to put maleconsumer=john into key of stringlist, so that in stringlist, john's record will be:
maleConsumer=john 9 // maleconsumer=john is key, 9 is value
In such case, how can I do it?
Thank you all for your help again.
key3 10instead?