Regular Expressions: How to convert tags to lower

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Juergen Ritzau

Regular Expressions: How to convert tags to lower

Post by Juergen Ritzau »

Hello,

I'm struggling with regular expressions :-(

I have a sorcecode (Visual FoxPro & HTML) I want to change the case of.
All text, which comes after a < I want to change to lower case until
special characters >, ] or + occour.

For example:

send([<TABLE WIDTH="200" BORDER="] + xBorder + [" CELLPADDING="5">] + CR)
send([ <TR>]+CR)
send([ <TD COLSPAN="2"><B>HELLO</TD>]+CR)


I want to look like:

send([<table width="200" border="] + xBorder + [" cellpadding="5">] + CR)
send([ <tr>]+CR)
send([ <td colspan="2"><b>HELLO</td>]+CR)


which means, all text within HTML-Tags schould be convertet to lower case.
(Note the word 'cellpadding' also should be converted to lower case!)

Any idea, how I can achive this using TextPad 4 and reguar expressions?

Many thanks for any hint!

Best Regards

Juergen
Jeff Epstein

Re: Regular Expressions: How to convert tags to lo

Post by Jeff Epstein »

Find What: <\([^<>]+\)>
Replace With: <\L\1>
Regular Expression: [X]

:' )

Regular expressions are tough to get started with. Once you get them, it's like riding a bicycle.

Does anyone know of an online source of Regular/Replacement Expression documentation? Are there any online sources for *examples* of this syntax (POSIX and non-POSIX)? Are there sources on the (dis-)advantages between these two different flavors?

People who don't know about Regular Expressions are *really* intimidated by it. The TextPad documentation does not have enough examples to help a beginner get over this hump. Personally, this was one of the most intimidating things for me, as far as TextPad functionality goes.
Post Reply