This is going to be a really short question...
Lets assume I have a regex like:
(Hello)(?:fooBar)
How can I backreference it using \2? I know this works with normal capturing groups and that a non capturing group only groups tokens together but if there is any work-around then I would be glad to know.
Edit: Problem is:
I need to backreference to non capturing groups sometimes. For example there are moments where I really dont want that group to show up as a match but it shows up multiple times in the pattern which is why I prefer to backreference it.
(Hello)(?:fooBar)(). Or an outer group:((Hello)(?:fooBar)). Or((Hello))(?:fooBar),(Hello)((?:fooBar)), etc. What are you trying to achieve?