mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 105
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Feb 2003
Posts: 105
the following script scans the script.ini file and extracts lines with the form "nxxx=alias" to the pre-declared @out window.
Code:
filter -fwg script.ini @out /n[0-9]+=alias/

I would like the regular expression to change the output from
this form
Quote:
n0=alias someAlias {

to this form
Quote:
alias someAlias {

but my regex skills are somewhat lacking.
I think I need to know more about back references.

cheers

H
Horstl
Horstl
H
Afaik you'd need to filter to an alias instead (as you do not filter captured things to <output>, but always the whole matching line). The alias can get rid of a part of the previously matched line, and add the rest to @out.

Code:
alias testing { filter -fkg script.ini test.filter /n[0-9]+=alias/ }
alias -l test.filter { aline @out $gettok($1,2-,61) }


Joined: Feb 2003
Posts: 105
L
Vogon poet
OP Offline
Vogon poet
L
Joined: Feb 2003
Posts: 105
Thanks Horstl.
I have already used an alias to get the
results i want, but I was looking for a more elegant
way of achieving my goal, if possible.


Link Copied to Clipboard