How to catch alternative into the nested group?
I want to return first capturing group of: (.*)((core\/)?\/misc\/drupal\.js) (i.e. anything before the string core/misc/drupal.js which may or might not contain core/).
However, the core/ part always gets included to the first capturing group and not the second as supposed.
See also this for an example.