11
To do it 'properly', you need to define some sort of grammar, and then maybe use a LALR parser or some tools such as yacc, bison or Lex to build a parser. Assuming you dont want to do that, its strpos() ftw!