Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function(scope, input) {
return api.init(
api.array,
...[].concat(
XRegExp.match(
input("self").value,
input("regex").value
)
).map(str => api.init(api.string, str))
);
}
))]
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+$/, '');
}