PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
yes, definitely the use of regex in place of fixed string makes thing bit slow... since php has to load/process the regex.
regex should be used _only_ when:
1. we have many patters to play with
2. we are not sure about the exact strings; only the patter are known.
for example, country name, we are not sure about the exact string but the expected pattern is any combination of lower case alphabets (a-z), upper case alphabets (A-Z) and space ( ) etc.