Re: Probably a dumb s/// question.
From: Paul Lalli (mritty_at_gmail.com)
Date: 03/16/05
- Next message: Glenn Jackman: "Re: Probably a dumb s/// question."
- Previous message: Mark Healey: "Probably a dumb s/// question."
- In reply to: Mark Healey: "Probably a dumb s/// question."
- Next in thread: Glenn Jackman: "Re: Probably a dumb s/// question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 16 Mar 2005 16:27:13 GMT
"Mark Healey" <die@spammer.die> wrote in message
news:pan.2005.03.16.16.17.19.236667@spammer.die...
> I'm trying to craft a search that capitalizes letters depending on
their
> context, specifically after a space or the beginning of a string.
>
> For example I'd like to turn
>
> the quick brown fox jumped over the lazy dogs.
>
> to
>
> The Quick Brown Fox Jumped Over the Lazy Dogs.
>
> Is this doable on a single line?
What have you tried so far?
Have you read the posting guidelines for this group, posted twice a
week?
Because I'm feeling generous (and bored) anyway:
s/(^|\s)([a-z])/$1\u$2/g;
for more information on ^, |, (), $1 & $2:
perldoc perlre
perldoc perlretut
perldoc perlreref
for more information on \u:
perldoc -f ucfirst
Paul Lalli
- Next message: Glenn Jackman: "Re: Probably a dumb s/// question."
- Previous message: Mark Healey: "Probably a dumb s/// question."
- In reply to: Mark Healey: "Probably a dumb s/// question."
- Next in thread: Glenn Jackman: "Re: Probably a dumb s/// question."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|