cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <morus.wal...@tanto.de>
Subject RE: processing when a pattern does NOT match
Date Wed, 22 Dec 2004 11:57:19 GMT
David Leangen writes:
> 
> 
> Conclusion: try the "^" operator. For example: "^[^(test)].*"
> 
> Please let me know when you figure this out.
> 
No. That cannot work.
^ is defined within character classes only as negation.
Outside it means the start of the string (`^a' matches `ab' but not `ba' 
whereas `a' matches both).

Probably something can be done using negative lookaheads but I'm not sure 
and don't have enough experience with cocoon to say, if that would work in
that context.

E.g.
^(?=foo)
matches every string starting with foo
^(?!foo)
strings not starting with foo.
In both cases the RE does not consume the matched/forbidden text (while
^foo does).
I guess ^(?!foo$) should match any text not beeing 'foo'.
(briefly tested with perl)

Morus

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message