Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   Case insensitive search. (http://www.go4expert.com/forums/case-insensitive-search-t423/)

Mike 22Aug2005 22:22

Case insensitive search.
 
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?

shabbir 23Aug2005 08:32

Re: Case insensitive search.
 
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

coderzone 23Aug2005 10:28

Re: Case insensitive search.
 
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.

Mike 27Aug2005 15:27

Re: Case insensitive search.
 
Thanks. that solved my problem.


All times are GMT +5.5. The time now is 02:39.