Article View: de.comp.lang.perl
Article #1Re: Regular Expression
From: Josef Wolf
Date: Mon, 27 Jul 1992 16:51
Date: Mon, 27 Jul 1992 16:51
33 lines
1379 bytes
1379 bytes
In <bof.711635297@midget.saar.de> bof@midget.saar.de (Patrick Schaaf) writes:
] elmar@knipp.en.open.de (Elmar Knipp) writes:
] >Wie kann ich folgende RE mit _einer_ Anweisung catchen:
] > .*AFFE.*
] > .*AFFEAFFE.*
] > .*AFFEAFFEAFFE.*
] > .*AFFEAFFEAFFEAFFE.*
] > .*AFFEAFFEAFFEAFFEAFFE.*
] > ...
] >In lex ist das kein Problem:
] > .*(AFFE)+.*
]
] Genau so vielleicht?
]
] while (<>) {
] if (/(AFFE)+/) {
BTW: /(AFFE)+/ ist was anderes als /.*(AFFE)+.*/
] print "Affe detected\n";
] }
] }
/.*AFFE.*/ sollte es doch auch tun. Wegen dem '.*' am Ende sind doch die
weiteren Zeilen ebenfalls in dieser expression enthalten.
Gruss
Sepp
--
| Josef Wolf, Germersheim, Germany aka sepp@ppcger.ppc.sub.org |
| +49 7274 8048 USR HST-DS 300-14400 V32/V32bis V42/V42bis/HST 24 Hours |
| ...und wieviel brave Deutsche haben wieder nichts geschnallt... (Marius) |
Technical Details
Message-ID:
<TkC2tG@ppcger.ppc.sub.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!smurf.sub.org!ppcnet!ppcger!SeppReferences:
<1992Jul18.094409.516@knipp.en.open.de> <bof.711635297@midget.saar.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!smurf.sub.org!ppcnet!ppcger!Sepp Message-ID: <TkC2tG@ppcger.ppc.sub.org> From: Sepp@ppcger.ppc.sub.org (Josef Wolf) Newsgroups: de.comp.lang.perl Subject: Re: Regular Expression Distribution: de Organization: PPC Germersheim, Germany Date: 27 Jul 92 16:51:32 GMT References: <1992Jul18.094409.516@knipp.en.open.de> <bof.711635297@midget.saar.de> Lines: 33