Jump to content

[SOLVED] preg_replace: newbie question abour regular expressions


Horst Azeglio

Recommended Posts

I'm trying to convert ever lowercase word "i" into an uppercase word I.
Here's my code.
[quote]
$string="This is my string. i am a regular expression illiterate";
$string=preg_replace("/[ \,\.!\?\']i[ \,\.!\?\']/","/[ \,\.!\?\']I[ \,\.!\?\']/",$string);
[/quote]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.