I need to match (case insensitive) ‘abcd’ and an optional trademark symbol
Regex: /abcd(™)?/gi
See example:
preg_match('/abcd(™)?/gi','AbCd™ U9+',$matches); print_r($matches);
When I run this, $matches isn’t populated with anything… Not even created as an empty array. Any ideas?
How is your file encoded? PHP has got issues when it comes to unicode. In your case, try using the escape sequence
\x99instead of directly embedding the TM symbol.