>> English << | česky | Deutsch | Español ZVON > Tutorials > Regular Expressions Tutorial
>> Example 25 << | Prev | Next | Contents | Regular Expressions

Description


(?=<pattern>) will look ahead if the pattern exists, but will not include it in the hit.

Source


AAAX---aaax---111

Case 1


Regular Expression: \w+(?=X)
First match:AAAX---aaax---111
All matches:AAAX---aaax---111

Case 2


Regular Expression: \w+
First match:AAAX---aaax---111
All matches:AAAX---aaax---111

Case 3


Regular Expression: \w+(?=\w)
First match:AAAX---aaax---111
All matches:AAAX---aaax---111