packages/shex-webapp/doc/webpacks/shex-webapp.js
// Translates regular expression escape codes in the string into their textual equivalent
Translates regular expression escape codes in the string into their textual equivalent
Translates regular expression escape codes in the string into their textual equivalent
function unescapeRegexp (regexp) {
    const end = regexp.lastIndexOf("/");
    let s = regexp.substr(1, end-1);
    const regexpEscapeReplacements = {
      '.': "\\.", '\\': "\\\\", '?': "\\?", '*': "\\*", '+': "\\+",
      '{': "\\{", '}': "\\}", '(': "\\(", ')': "\\)", '|': "\\|",
      '^': "\\^", '$': "\\$", '[': "\\[", ']': "\\]", '/': "\\/",
      't': '\\t', 'n': '\\n', 'r': '\\r', '-': "\\-", '/': '/'
    };
    s = ShExUtil.unescapeText(s, regexpEscapeReplacements)
    const ret = {
      pattern: s
    };
    if (regexp.length > end+1)
      ret.flags = regexp.substr(end+1);
    return ret;
  }
function unescapeRegexp ( regexp ) { const end = regexp . lastIndexOf ( "/" ) ; let s = regexp . substr ( 1 , end - 1 ) ; const regexpEscapeReplacements = { '.' : "\\." , '\\' : "\\\\" , '?' : "\\?" , '*' : "\\*" , '+' : "\\+" , '{' : "\\{" , '}' : "\\}" , '(' : "\\(" , ')' : "\\)" , '|' : "\\|" , '^' : "\\^" , '$' : "\\$" , '[' : "\\[" , ']' : "\\]" , '/' : "\\/" , 't' : '\\t' , 'n' : '\\n' , 'r' : '\\r' , '-' : "\\-" , '/' : '/' } ; s = ShExUtil . unescapeText ( s , regexpEscapeReplacements ) const ret = { pattern : s } ; if ( regexp . length > end + 1 ) ret . flags = regexp . substr ( end + 1 ) ; return ret ; }
Translates regular expression escape codes in the string into their textual equivalent
Translates regular expression escape codes in the string into their textual equivalent