Two new "and" and "or" methods on RegExp objects that concats regex's into and/or sequences
/\w/.and(/\d/, /\s/).or(/\S/)
Becomes the final RegExp
/(?=(?=\w)(?=\d)(?=\s))|(\S)/
A better example of this would be if the inline RegExp expressions where distinct variables there where used also used else where, that you could import and compose into another RegExp.
@thysultan the .or method is straightforward, the meaning of .and however less so, especially if you want to further compose the RegExps.
RegExps (and formal grammars, more generally) already have an and operator: the pattern sequence, which is represented as concatenation/juxtaposition in most notations. The identity for the operator is a pattern that always matches. /(?:)a/ === /a(?:)/ === /a/.
As for or operations, the disjunction's identity is a pattern that always fails: /a|$./===/$.|a/===/a/`.
You're proposing a third kind of semantics here... I kind of see why you'd want to punt on how much characters the result consumes, by consuming none... It's an interesting solution.