Stefan Monnier writes: > FWIW, I find it's cumbersome in RX to define regexps piecewise. > E.g. with strings I can do things like: > > (let* ((word-re "\\(?:\\sw\\|s_\\)+") > (spc-re "[ \t\n]*") > (re1 (concat spc-re "\\(" word-re "\\)" spc-re)) > (re2 (concat spc-re "\\(" word-re "\\)(" word-re)))) > > but do the same with RX you need something like: > > (let* ((word-re (rx ...)) > (spc-re (rx ...)) > (re1 (rx-to-string `(... ,spc-re ... ,word-re ...))) > (re2 (rx-to-string `(... ,spc-re ... ,word-re ...)))) > > I think `rx` would benefit from allowing to refer to variables. Not sure what you are trying to do, but doesn't it work with (rx (... (eval VARIABLE) ...)) ? -- Pierre Neidhardt