How to use the xregexp.match function in xregexp

To help you get started, we’ve selected a few xregexp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cheddar-lang / Cheddar / src / stdlib / primitive / String / lib / matches.es6 View on Github external
function(scope, input) {
        return api.init(
            api.array,
            ...[].concat(
                XRegExp.match(
                    input("self").value,
                    input("regex").value
                )
            ).map(str => api.init(api.string, str))
        );
    }
))]
github rexxars / nodehun-sentences / index.js View on Github external
function trimWord(word) {
    var LTrim = xRegExp('^[^\\p{Letter}\\p{Number}]*', 'ig');
    var lettersOnly = xRegExp('^(\\p{Letter}*[.\'’@-]*\\p{Number}*)*', 'ig');
    word = xRegExp.replace(word, LTrim, '');
    word = xRegExp.match(word, lettersOnly, 'one');
    word = word ? word : '';
    return word.replace(/^\d+$/, '');
}