鉴于我有format1 = wb.add_format({'bg_color':#87c2ff ,'locked': False})
ws.conditional_format(colrang, {'type': 'cell',
'criteria': 'not equal to',
'value': rowIndx,
'format': format1,
})
个不同的模式,我希望N
检查每个模式:
str_replace
例如,这是我的模式:
pat_list <- pattern1|pattern2| ......|patternN
str_replace(string, pattern = pat_list)
现在如何“告诉” [1] "123-5" "123-05" "123-1" "39-33" "05" "44-078" "31-6" "972-11" "45-" "33-7" "49-17" "20-12" "123-" "User_52" "44-79" "33-6"
[17] "44-75" "358-4" "43-699" NA ""
使用模式列表?
答案 0 :(得分:0)
也许您需要的是
patterns <- c("123-5", "123-05", "123-1")
str_replace_all("123123-50123-0533", paste(patterns, collapse = "|"), "")
# [1] "123033"