Negative Lookahead (?! ... ) and Positive Lookahead(?= ... )
- Negative lookahead is indispensable if you want to match something not followed by something else.
- Positive lookahead is indispensable if you want to match something followed by something else.
- Positive/Negative Lookahaed は「結果マッチ」には含まれない。テストのみ行う
- マッチしなかったら、成功となり、カーソルは前に戻る。
/^a(?!xyz)b$/
a = false
axyzb = false
ab = true : ab