Look ahead from two different points in the pattern might be another valid way to formulate it.
I’d like to condition the parsing of e.g. ()
parenthesis and I’d like to detect whether something in what I parsed is enclosed in parenthesis and maybe (in the regex pattern) capture both the (
and the )
under the same group while the content in between is filtered.
The way I think to approach it is to make a sort of look ahead group that matches ()
if )
is detected at a specific(user determinable) point in the pattern or the end of it and I’m not sure what token is used for that if is a feature available at all?
e.g. pattern I try to capture(nothing to detect and capture ()
here)
(https?[:]//)?(www.)?([0-9a-z-]+).([^/]+)([^ tn]+)
lookahead but not sure how to assert and refer to “The end of pattern”