How to use the isRegExp function from xregexp

Find comprehensive JavaScript xregexp.isRegExp code examples handpicked from public code repositorys.

27
28
29
30
31
32
33
34
35
36
const nonCapturingGroup = (content = '') => `(?:${content})`;

const anchors = /^\^|\$$/g;

const processInterpolation = v =>
    XRegExp.isRegExp(v)
        ? nonCapturingGroup(v.source.replace(anchors, ''))
        : nonCapturingGroup(XRegExp.escape(v));

const regex = (flags) => (s, ...args) =>
fork icon0
star icon0
watch icon1