Regex "or" Expression
Posted
by
David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2012-06-04T10:30:10Z
Indexed on
2012/06/04
10:40 UTC
Read the original article
Hit count: 189
This is probably a really basic question, but I can't find any answers. I need to match a string by either one or more spaces OR an equals sign.
When I split this string: 9 x 13 = (8.9 x 13.4) (89 x 134)
with ( +)
I get:
part 0: 9 x 13 = (8.9 x 13.4)
part 1: (89 x 134)
When I split it with (=)
I get:
part 0: 9 x 13
part 1: (8.9 x 13.4) (89 x 134)
How can split by BOTH? Something like: (=)OR( +)
Edit:
This does not work(=)|( +)
Test it here: http://myregexp.com/ under "split".
© Stack Overflow or respective owner