[英]Regex with $ anchor and look ahead
/ab(?=.{1})$/g
與“ abdabd”或其他不匹配
是錨$困擾着我。 這個正則表達式可以匹配什么?
這個正則表達式可以匹配什么?
此正則表達式將不匹配任何內容,並保證會失敗,因為:
ab - will literally match ab
(?=.{1}) - will use lookup to make sure there is at least 1 character after ab
$ - will assert end of input after ab
這兩個條件都無法滿足,因此您的正則表達式將始終失敗。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.