Case insensitive search.

Mike's Avatar
Go4Expert Member
I have implemented a regular expression search system where preg_match() search a particular word in file. The problem with this fuunction is it is case sensative that is it searches when exact case is found,but not the exact word for example preg_match(). what is the solution?
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
In the preg_match function to create a regular expression that is case insensitive you just need to add "/i" and that should do the job. You can refer the following thread for complete details
Mastering Regular Expression
0
coderzone's Avatar, Join Date: Jul 2004
Team Leader
Quote:
to create a regular expression that is case insensitive you just need to add "/i" and that should do the job
preg_match uses perl compatible regular expression.
0
Mike's Avatar
Go4Expert Member
Thanks. that solved my problem.