[thelist] Regular Expression in Javascript

Bob Haroche spambait at onpointsolutions.com
Mon Jun 16 23:39:41 CDT 2003


Thorne, Brenton wrote:
> I've been trying for ages and can't get anything to work >:0
>
> I need an RE to replace all <A> tags with <U> tags in a string of
> HTML

Wouldn't this work to match the opening and closing <a> tags?

<a[^>]*>    # opening <a>
</a>           # closing </a>

As for your other post,

> Why would this not return any instances of '<a'  ?
(snip)
> re = /<a/gi;

Might be that /< is a meta-sequence to match the start of a word -- in
your case, a word that starts with plain old "a".


-------------
Regards,
Bob Haroche
O n P o i n t  S o l u t i o n s
www.OnPointSolutions.com




More information about the thelist mailing list