A simple regex tester. To activate, type /retest or just right click in any window and select "Regex Tester", then, simply follow the instructions in the dialog.
Notes:
[list=1][]You must use ( ) around any regex whose matches you want listed on the side[]This script will currently not evaluate $idenfiers or %variables (Planned)[*]This script will not match at newlines (planned, hopefully)[/list]
For regex help, I recommend: www.regular-expressions.info
Updated to no longer use var.
/*
{
Simple Regex Tester by Meta/Xse/Iire
Questions, Comments, Bugs? I am:
Meta on irc.mountai.net, irc.swiftirc.net, irc.dal.net
Xse on irc.efnet.org, irc.quakenet.org, irc.mountai.net (phone nick)
** Note: Where I am Xse I am NOT Meta, but not necessarily vice versa
}
*/
menu * {
Regex Tester:retest
}
; ------------------------------------------------------------ ;
dialog retest {
title Regular Expressions Tester
size -1 -1 280 220
option dbu
text Enter RegEx Pattern ( Without // or Modifiers ):,1,4 4 142 8
edit ,2,4 12 132 10
text Modifiers:,3,140 4 132 8
check Case Insensitive,4,140 12 48 10
check Global,5,192 12 24 10
check Strip Control Codes,6,220 12 56 10
text Enter String to test against: ( Tip - Right Click and choose Select All to Select All ),7,4 28 212 8
edit ,8,4 36 212 176,multi autovs
text Match List:,9,224 28 52 8,center
combo 10,224 36 52 176,size edit
}
on *:DIALOG:retest:EDIT:2,8:listre $dname
on *:DIALOG:retest:SCLICK:4,5,6:listre $dname
; ------------------------------------------------------------ ;
alias retest dialog $iif($dialog(regextest),-v,-m) retest retest
alias -l listre {
did -r $1 10
var %m, %l 1, %r $+(/,$did($1,2),/,$+($iif($did(4).state,i),$iif($did(5).state,g),$iif($did(6).state,S)))
while ($did($1,8,%l) != $null) {
if ($regex($v1,%r)) {
%m = 1
while ($regml(%m) != $null) {
did -a $1 10 $v1
inc %m
}
}
inc %l
}
}
You could use http://www.regex101.com . The creator is a user, and time-to-time contributor here at Hawkee. :)
Haha, definitely much more feature-rich than mine!
Of course this snippet is just provided as a quick and easy way to test regex directly from within mIRC, so... idk; take it or bake it. (That's the expression, right?)