Schrift
[thread]8800[/thread]

suchen und ausschliessen

Leser: 1


<< >> 3 Einträge, 1 Seite
Gast Gast
 2007-03-01 11:44
#74718 #74718
ich möchte eine zeile finden, in der ein wort steht, aber gleichzeitig ein anderes wort nicht. in einem patern matching sollen also zwei regex verwurstet werden. geht das und wenn ja wie?
Taulmarill
 2007-03-01 11:59
#74719 #74719
User since
2004-02-19
1750 Artikel
BenutzerIn

user image
hm.... es währe einfacher, wenn du einfach zwei matches machst und die verknüpfst. so was wie
Code: (dl )
if ( $line =~ /dashier/ and $line !~ /dasnicht/ ) { ....
$_=unpack"B*",~pack"H*",$_ and y&1|0& |#&&print"$_\n"for@.=qw BFA2F7C39139F45F78
0A28104594444504400 0A2F107D54447DE7800 0A2110453444450500 73CF1045138445F4800 0
F3EF2044E3D17DE 8A08A0451412411 F3CF207DF41C79E 820A20451412414 83E93C4513D17D2B
sesth
 2007-03-01 12:19
#74720 #74720
User since
2005-02-01
181 Artikel
BenutzerIn
[default_avatar]
Schau mal unter perlre:
Code: (dl )
1
2
(?!pattern) 
A zero-width negative look-ahead assertion. For example /foo(?!bar)/ matches any occurrence of ``foo'' that isn't followed by ``bar''. Note however that look-ahead and look-behind are NOT the same thing. You cannot use this for look-behind.
Gruß
Thomas
<< >> 3 Einträge, 1 Seite



View all threads created 2007-03-01 11:44.