* Thus wrote Shmuel ([EMAIL PROTECTED]): > Eugene Lee wrote: > >On Thu, Oct 16, 2003 at 03:35:57PM +0300, Shmuel wrote: > >: > >: I have a misspelled sentence like this: "I am not aIone". > >: I want to change the capital I to small l, but only in > >: the beginning of a word. > > > >This doesn't make sense. It sounds like you want to replace every > >occurance of 'I' inside a word with a 'l'. > > > > preg_replace('/(\B)I(\B)/', '\1l\2', $yourstring) > > > >Then again, I could be misreading. > > I want to replace every occurance of 'I' inside a word with a 'a', > but *NOT* in the beginning of the word. ie. Ill doesn't change, > but miIk changes to Milk. > > This is a problem that occurs whit subrip. It can't distinguish > between those two letters.
Is one of your end users' keyboard misslabeled and they use an 'I' instead of an 'l'. Trying to fix mispellings this way makes no sense at all. You want to use pspell module for checking for spelling and fixing them. http://php.net/pspell Curt -- "My PHP key is worn out" PHP List stats since 1997: http://zirzow.dyndns.org/html/mlists/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php