[TF] PROMPT HOOK regexp matches, but %Pn won't be set?
Brought to you by:
kenkeys
|
From: johans at stack.nl (J. v. Selst) - 2003-03-26 10:32:56
|
Hi Stefan,
Stefan Linnemann wrote:
> I'm trying to get stuff from my MUC?D pompt in variables, but can;t seem
> to get it to work, even after reading the relevant help pages.
> /def -p1 -mregexp -h"PROMPT ^[[3.m([0-9]*)h, ^[[..m^[[..m([0-9]*)m
> [[..m([a-z]*-)" prm_hook = /set hitp=%P1 %;/set manap=%P2%;/test
> prompt({*})
I don't think that matching on colours will work: just ignore the
colours in your expression. Besides the '[' character has a special
meaning in regular expressions, but you are using it as a litteral
character as well (it should be escaped with a '\' in that case).
Try something like this instead:
/def -p1 -mregexp -h"prompt ([0-9]*), ([0-9]*) [a-z]*" prm_hook = \
/set hitp=%P1 %;\
/set manap=%P2
Ciao,
Johan
--
Johan van Selst <jo...@st...> Koresh@OuterSpace
PGP: finger jo...@va... telnet mud.stack.nl 3333
|