iter-tools / regex

A streaming regex evaluation engine
MIT License
11 stars 1 forks source link

Support regex literal as expression #12

Closed conartist6 closed 3 years ago

conartist6 commented 3 years ago

E.g.

const { parse } = require('@iter-tools/regex');
const exp = parse(/foo/g);

Both the source and the flags would be read from the expression in this case, and an error would be thrown if a flags string was also specified. The error should specify to write expr.source if flags need to be overwritten.