Search code examples
phpregexpomo

use regexp to search function calls in code


i try to make .mo files from my sources in php by finding "t()" function calls, i know that one better way is using regex functions like preg_match or something, but i'm not the better creating regular expresions, any help?

(and sorry for my english...)


Solution

  • No, preg_match is not better. When you want to parse PHP code, use the tokenizer. It is far more reliable.