F**e 发帖数: 593 | 1 what's the regular expression for "not contaning colon", for which
the following will return 1:
aabbcc
and the following will return 0:
aabb:cc
Thanks. |
w*******g 发帖数: 51 | 2 /[^:]/g, well, following perl convention.
【在 F**e 的大作中提到】 : what's the regular expression for "not contaning colon", for which : the following will return 1: : aabbcc : and the following will return 0: : aabb:cc : Thanks.
|
o***z 发帖数: 133 | 3 把match "containing colon"的结果反一下成不?
【在 F**e 的大作中提到】 : what's the regular expression for "not contaning colon", for which : the following will return 1: : aabbcc : and the following will return 0: : aabb:cc : Thanks.
|
F**e 发帖数: 593 | 4 How to invert?
"match colon" would be "[:]", but "[^:]" returns 1 in both cases.
【在 o***z 的大作中提到】 : 把match "containing colon"的结果反一下成不?
|
p******f 发帖数: 162 | 5
if perl, you can say,
$_ !~ /:/;
or
$_ =~ /^[^:]*$/;
【在 F**e 的大作中提到】 : what's the regular expression for "not contaning colon", for which : the following will return 1: : aabbcc : and the following will return 0: : aabb:cc : Thanks.
|
o***z 发帖数: 133 | 6 change 'if' to 'unless'?
【在 F**e 的大作中提到】 : How to invert? : "match colon" would be "[:]", but "[^:]" returns 1 in both cases.
|