Thanks, Andrew. I don't think abbreviated depvar names will affect what I am doing. I just tried it and it seems to work fine. I'll try to break it...
result:
Code:
sysuse auto
logit for mp weight turn
local wanted= ustrregexra(ustrregexra("`e(cmdline)'", "(\b`e(cmd)'\b|\b`e(depvar)'\b)", ""), "^(.+?)(\bif\b|\bin\b|\,)(.*)", "$1")
di "`wanted'"
Code:
for mp weight turn

Comment