I was using character class in regular expression to split a string. I had an assumption that order of characters in the character class does not matter.
Following are the two patterns I was using to split the string "123.3+23+23.3"
.
[+/*-]
[+*-/]
For the first pattern I got the output as:
123.3
23
23.3
For the second pattern I got the output as :
123
3
23
23
3
I've no idea, why I am getting the different outputs. Please help me out.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.