=> (...args) => XRegExp(String.raw(...args), flags);
// usage
const mainRegex = regex('six')`^/
(?<lang> ${languageRegex.source})
(?<username> @\w+)?
\s+
(?<code> .+?)
(?:
\s+
/stdin
\s+
(?<stdin> .+)
)?
$`;
(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals, "Tagged template literals" section")
but, why is it after you close parentheses
so, regex is a function which takes a flag and returns tagging function for those flags!
Interesting
I also changed it slightly now, so it uses XRegExp.build now, and regex takes subs in addition to flags
actually... actually... I could handle substitutions as well! Strings could get regex-escaped, and source of regexes would be inserted as-is
whoa
Обсуждают сегодня