你好,比如sed中seq 1 20 | sed -E '/2$/,/8$/d',会得到1 9 10 11 19 20请问在python要怎么用regex实现?谢谢
emmmm,没看懂你的例子,你的意思说说用正则替换字符??
a=' '.join([str(x) for x in range(1,21)]) b=' '.join([x for x in a.split() if int(x)%10<2 or int(x)%10>8])