Thread Regex-Frage (11 answers)
Opened by Gast at 2009-12-20 19:10

Gast LanXoff
 2009-12-23 12:50
#129622 #129622
wenn denn gefragt sein sollte, dass mindestens ein Teilausdruck matcht...

warum nicht einfach gleich darauf testen?


Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
  DB<1> $t='\w'

  DB<2> if ( "aaa ; " =~ /($t)?( ; )($t)?/ and "$1$3" ne "") {  print "$1$2$3"} 
aaa ; 
  DB<3> if ( "aaa ; bbb" =~ /($t)?( ; )($t)?/ and "$1$3" ne "") {  print "$1$2$3"}
aaa ; bbb
  DB<4> if ( " ; bbb" =~ /($t)?( ; )($t)?/ and "$1$3" ne "") {  print "$1$2$3"}
 ; bbb
  DB<5> if ( " ; " =~ /($t)?( ; )($t)?/ and "$1$3" ne "") {  print "$1$2$3"}

  DB<6> 

View full thread Regex-Frage