If I get it right then a positive look ahead ( ?= ) as well a non-capturing group ( ?: ) are used for to excluse a part of the string in the final match-results.
What is the difference between the a lookahead and a non-capturing group?
Can anyone explain? Preferable with an easy understandable example?
A positive look ahead is a zero width assertion. This means that it will not consume an input, e.g. in
(?=.) part will match with the first characters of the string and the
. will match with the same character. On the other hand
(?:.) part will match with the first characters of the string (just like before) but the
. will match with the second character because the first character will have been consumed by the parentheses.