[thelist] Regex apostrophe problem
Anthony
apwebdesign at yahoo.com
Thu Aug 18 15:52:00 CDT 2005
What language?
Perl has functions for uppercase and lowercase:
uc($text) and a lc($text) function, which should
already ignore special characters.
If you must use regexp:
$lower =~ s/(\w)(\w+)/\u$1\L$2/sig;
--- fstorr <fffrancis at fstorr.demon.co.uk> wrote:
> Hi all
>
> I'm trying to write a regex that will change the
> case of text from
> all upper to title case so, from BOB O'NEIL to Bob
> O'Neil. I'm
> getting stuck where apostrophes come into play as
> the N after the
> apostrophe needs to be capitalised along with the
> preceding O. I've
> got this so far:
>
> Find: ([\w]{1})([\w]+)
> Replace: $1\L\$
>
> But don't know how to deal with the apostrophes. Is
> it possible to
> do this, and if so, how?
>
> regards
>
> Francis
>
> --
>
> * * Please support the community that supports you.
> * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip
> Harvester
> and archives of thelist go to:
> http://lists.evolt.org
> Workers of the Web, evolt !
>
Anthony
ph: (408) 656-2473
blog: http://www.chovy.com
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
More information about the thelist
mailing list