mIRC Home    About    Download    Register    News    Help

Print Thread
#169900 30/01/07 02:43 PM
K
klaaamp
klaaamp
K
If I use $regex, can I output what it grabbed instead of 1 or 0?

#169903 30/01/07 03:13 PM
Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
/help $regml

-genius_at_work

#169918 30/01/07 10:43 PM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
Group the pattern which matches your wishes result "()" then use $regml(N) N refers to the Nth result.

b1ink #169956 31/01/07 09:06 AM
K
klaaamp
klaaamp
K
I tried with var %regml = $regex(%var1,\d\d\d\d) | set %year $regml(1) but %year is just blank smirk whats wrong?

#169957 31/01/07 10:55 AM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
Regex Grouping read this for more info.
As for your example you didn't group your pattern as below:
$regex(%var1,(\d\d\d\d))

#169958 31/01/07 10:56 AM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
Also enclose your pattern with // so it would make it easy for you to use the modifiers.


Link Copied to Clipboard