T
teo
I need to implement a boolean evaluation
in a Regular Expression like this:
(aaa AND bbb) OR (ccc AND ddd)
(see the #3 case)
- - -
1)
If I need to match a single word only,
no problem:
MyString = "hallo"
MioMatch = Regex.Match(MyBigText, MyString)
2)
If I need to match a couple of words in OR relation,
I think I have to use the 'pipe' |
in this way:
MyString = "dog|cat"
MioMatch = Regex.Match(MyBigText, MyString)
3) here the problem
If I need to match
a couple of words (in AND relation),
and evaluate them in OR relation
with another couple of words (in AND relation),
like this:
(dog AND cat) OR (milk AND coffe)
How can I achieve this ?
This obviously doesn't work:
MyString = "(dog AND cat) OR (milk AND coffe)"
MioMatch = Regex.Match(MyBigText, MyString)
in a Regular Expression like this:
(aaa AND bbb) OR (ccc AND ddd)
(see the #3 case)
- - -
1)
If I need to match a single word only,
no problem:
MyString = "hallo"
MioMatch = Regex.Match(MyBigText, MyString)
2)
If I need to match a couple of words in OR relation,
I think I have to use the 'pipe' |
in this way:
MyString = "dog|cat"
MioMatch = Regex.Match(MyBigText, MyString)
3) here the problem
If I need to match
a couple of words (in AND relation),
and evaluate them in OR relation
with another couple of words (in AND relation),
like this:
(dog AND cat) OR (milk AND coffe)
How can I achieve this ?
This obviously doesn't work:
MyString = "(dog AND cat) OR (milk AND coffe)"
MioMatch = Regex.Match(MyBigText, MyString)