![](/img/trans.png)
[英]if with regex - string matches either entire string OR entire string + another character?
[英]regex matches entire string “waswas”
對“waswas”執行的這個正則表達式會返回整個字符串,除非我將其設為“waspwas”。
w[^p]*s
我怎樣才能讓這個正則表達式返回兩個單獨的匹配項?
如果要將w
作為斷點,則需要將其排除在中間匹配之外。
w[^pw]*s
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.