in reply to Re: Using undefined back-references?
in thread Using undefined back-references?

Won't do it, I'm afraid, 'cos I actually need to keep that crud, if it exists. Especially if somebody throws me the attributes in a different order:

<e st="obs" num="1" st="ali">
needs to group in the same way. By using ?: the entire intermediate string disappears, and I end up with
<e st="obs,ali">
Which wasn't precisely what I was after. Although it does shut the warning up :-)

--
Tommy
Too stupid to live.
Too stubborn to die.

  • Comment on Re: Re: Using undefined back-references?

Replies are listed 'Best First'.
Re: Re: Re: Using undefined back-references?
by fruiture (Curate) on Aug 19, 2002 at 16:31 UTC

    How about

    ((?:\s+[^>]*)?)\s+ # Optional assorted crud

    ? The capturing () is not marked with ? (or *) so it won't be undef, but the non-capturing (?:) is marked with ?, so it can fail to match: in that case the () saves an empty string, not undef.

    --
    http://fruiture.de