Thread String Mustererkennung (4 answers)
Opened by perlnerd at 2013-08-26 15:31

GwenDragon
 2013-08-26 15:54
#169756 #169756
User since
2005-01-17
14748 Artikel
Admin1
[Homepage]
user image
Dein Regex match alles was Zeichenkette element gefolgt von einer/mehreren Ziffern und keinem Unterstrich ist.

U:\>perl -E "say ("element9" =~ /element[0-9]+(?!\_)/i)"
1

U:\>perl -E "say ("element91" =~ /element[0-9]+(?!\_)/i)"
1

U:\>perl -E "say ("element91a" =~ /element[0-9]+(?!\_)/i)"
1

U:\>perl -E "say ("element_91a" =~ /element[0-9]+(?!\_)/i)"


U:\>perl -E "say ("element_test" =~ /element[0-9]+(?!\_)/i)"


U:\>perl -E "say ("element_test3" =~ /element[0-9]+(?!\_)/i)"


U:\>perl -E "say ("element3" =~ /element[0-9]+(?!\_)/i)"
1

U:\>perl -E "say ("element3a" =~ /element[0-9]+(?!\_)/i)"
1

Last edited: 2013-08-26 15:58:12 +0200 (CEST)

View full thread String Mustererkennung