Positive/Negative Lookahead Confusion

Link: Positive/Negative Lookahead
I am very VERY confused by this.
The text says very little.

A positive lookahead will look to make sure the element in the search pattern is there, but won't actually match it. A positive lookahead is used as (?=...) where the ... is the required part that is not matched.

On the other hand, a negative lookahead will look to make sure the element in the search pattern is not there. A negative lookahead is used as (?!...) where the ... is the pattern that you do not want to be there. The rest of the pattern is returned if the negative lookahead part is not present.

“But won’t actually match it” says nothing about what it does match.
"It's a big apple"
\(?=It's)\ → Wont match “apple”

Also looking online(which lead to more confusion) said something this lesson said nothing about.
How they HAVE to be a group()

Also what’s the deal with ?>=, ?<=?, lookbehind
Im very confused by these in everyway possible.

“A more practical use of lookaheads is to check two or more patterns in one string.”

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.