Your regex in the if() has problems. \w represents 'word characters', letters, numbers, and underscore. Your regex is looking for a \w+ immediately after the 'OF'. You need to account for the whitespace in your regex. Im not exactly sure what your data will all potentially look like, but if the value you are looking for is the only thing in parenthesis, you could: