Unfortunately this will also match strings that don't contain the substring "weird". Without using lookbehind lookahead, this problem will probably require two tests (one to test for "weird" and one to test for "odd"), since we only want strings containing "weird" but not "odd" before "weird". That was an odd sentence, how weird. :-)