On Tue, May 22, 2012 at 02:33:34PM -0700, Be wrote:
> What I need now is something that says, "Look between <div class="topic"> 
> and the first </div> that follows it. Find instances where an uppercase 
> character is followed by another uppercase character. Turn these instances 
> into title case."

This is not possible with a simple grep, because you need to do a loop
inside a loop.  You'll a need script of some kind.

Here's how you might do it in Perl:

#!perl -p0

s{(<div class="topic">)(.*?)(</div>)}
 < { ($x = $2) =~ s!([A-Z]+)!\L\u$1!g } "$1$x$3" >sge;

__END__


I have to run, but I can send a followup later explaining what this is
doing.  Sorry!


Ronald

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, 
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to