我有这样的条目:
XYZABC------------HGTEZCW
ZERTAE------------RCBCVQE
I would like to get just HGTEZCW and RCBCVQE . I would like to use a generic regex.
$temp=~ s/^s+//g; (1)
$temp=~ s/^w+[-]+//g; (2)
If i use (1) + (2) , it works.
It works i get : HGTEZCW
, then RCBCVQE
...
我想知道,在以下一行中,是否有可能做到这一点:
$temp=~ s/^s+w+[-]+//g; (3)
当我使用第(3)条时,即取得这一结果: HGTEZ : / 准则
我无意理解为什么不可能将1+2混为一谈。
我的条目是:
XYZABC------------HGTEZCW
ZERTAE------------RCBCVQE
Also, the regex 1 remove space but when i use regex2, it remove XYZABC------------ .
But the combination (3), don t work.
i have this XYZABC------------HGTEZCW
@Tim So there always is whitespace at the start of each string? yes