Tag Stefan.
ich möchte ungefähr folgendes realisieren:
...(<string-a>)-(<string-b>)-([not-strings-c-to-e]<string-f>)-(<string-g>)...
Wie/Wo soll ich hier den negative Lookaround einbauen?
/^string1(?!(string2|string3))string4$/
Beispiel:
while (<DATA>)
{
# String darf weder abcd noch abxy enthalten
if ($_ =~ /ab(?!(cd|xy))/ ) {
print "matched in line $.\n";
}
else {
print "no match in line $.\n";
}
}
__DATA__
abcdef
wabxye
ab00ef
Ergibt:
no match in line 1
no match in line 2
matched in line 3
Als Ansatz sollte das ausreichen, oder?
Siechfred