Reputation: 229
I was wondering, how do I create create a regular expression that allows me to use something akin an "or" statement. For example,
^\w+? [\s?] OR [\\w\\W]*?]$
where the brackets represent the condition.
Upvotes: 0
Views: 60
Reputation: 27791
Like this:
(thing1|thing2)
This will match either "thing1" or "thing2" - see here for more info.
In your example it would be:
^(\w+? [\s?]|[\w\W]*?])$
Upvotes: 4