SEARCH for multiple strings
Posted: Thu Aug 16, 2018 5:45 am
MATCHES is using a regex that looks for 2 strings, "40" and "GS".
It should return a tuple where it finds either string. And it does, returning ID 2 and ID 4.
Using the same regex I was hoping SEARCH would return a tuple where either string was found.
But in this case SEARCH is true for all tuples.
Of course using multiple SEARCH terms works.
Is there any way, perhaps using another form of regex, to get a single SEARCH working looking for multiple strings?
Code: Select all
REL{TUP{ID 1,A "5A053"}, TUP{ID 2, A "64GS6"}, TUP{ID 3, A "YYYY"}, TUP{ID 4, A "X40F"}} WHERE MATCHES(A,"(.*40.*)*(.*GS.*)*")
Code: Select all
RELATION {ID INTEGER, A CHARACTER} {
TUPLE {ID 2, A "64GS6"},
TUPLE {ID 4, A "X40F"}}
Code: Select all
REL{TUP{ID 1,A "5A053"}, TUP{ID 2, A "64GS6"}, TUP{ID 3, A "YYYY"}, TUP{ID 4, A "X40F"}} WHERE SEARCH(TUP{*},"(.*40.*)*(.*GS.*)*")
Code: Select all
RELATION {ID INTEGER, A CHARACTER} {
TUPLE {ID 1, A "5A053"},
TUPLE {ID 2, A "64GS6"},
TUPLE {ID 3, A "YYYY"},
TUPLE {ID 4, A "X40F"}}
Code: Select all
REL{TUP{ID 1,A "5A053"}, TUP{ID 2, A "64GS6"}, TUP{ID 3, A "YYYY"}, TUP{ID 4, A "X40F"}}
WHERE SEARCH(TUP{*},".*40.*") OR SEARCH(TUP{*}, ".*GS.*")