Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Conditional look-ahead?

Reply
Thread Tools

Conditional look-ahead?

 
 
Steve Dunn
Guest
Posts: n/a
 
      10-29-2003
I'm stuck with a regular expression that closes tags if a closing tag
doesn't already exist. It's probably easier to demonstrate than explain, so
here goes:

I need to turn the following structure:

<TAG1>
<TAG2>foo
<FOOBAR>
<TAG3>I'm ok</TAG3>
</TAG1>

into the follow:

<TAG1>
<TAG2>foo</TAG2>
<TAG3 />
</TAG1>

So, TAG1 and TAG3 are left alone, as they contains a closing tag, TAG2 is
closed because there's text and no closing tag, and <FOOBAR> is closed
because there's no text and closing tag.

Any help very much appreciated,

Thanks,

Steve.
p.s. I'm using the .NET regex classes


 
Reply With Quote
 
 
 
 
Brian Harnish
Guest
Posts: n/a
 
      10-29-2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 29 Oct 2003 14:16:33 +0000, Steve Dunn wrote:
[snip...]
> p.s. I'm using the .NET regex classes


So, then, your asking in a perl group why?

Try a .NET group.

- Brian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/n+OKiK/rA3tCpFYRAiv7AJ9t6RpNYJsVucIZYfHNznev7sJzPACfW3oA
FrXF4X7/pRB2ddi0kClTigQ=
=Zdft
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      10-29-2003

Brian Harnish <(E-Mail Removed)> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----


Not wishing to cause trouble or anything, but is it *really* necessary
to sign a message which is itself shorter than the signature?

Ben

--
The cosmos, at best, is like a rubbish heap scattered at random.
- Heraclitus
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
? ELSE Conditional Comment / Using Conditional Comments Inside Other Tags To Comment Out Attributes Alec S. HTML 10 04-16-2005 02:21 AM
Preprocessor conditional compilation variable not being saved Chris P ASP .Net 0 10-28-2003 08:48 PM
Comparison of Bit Vectors in a Conditional Signal Assignment Statement Anand P Paralkar VHDL 2 08-04-2003 08:40 PM
Help: conditional attribute assignment itsme VHDL 1 07-23-2003 03:26 PM
Conditional signal declaration Willem Oosthuizen VHDL 5 07-17-2003 03:25 PM



Advertisments