I need using regular expressions to match special key and values. There is a special condition that I do not know how to do.
The string likes abcd/abcd
. I need match all single words before /
.
So I write (.)*/
, and then I found it only match 1 token (d). What's more, even it matches all I need, I still do not know how many tokens matched.
So what should the correct regular expressions be? The real condition is much more complex than the example, so if it can be achieved by regular expressions, I do not want write a tokenizer.