mIRC Home    About    Download    Register    News    Help

Print Thread
Real quick Help #61959 27/11/03 12:17 AM
Joined: Jan 2003
Posts: 119
A
AKO Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2003
Posts: 119
Hey I need some help with regular expressions, would someone here help me write a regular expression match for the EXACT mIRC version reply. It must meet the following criteria:

- must be case sensitive to the mIRC version reply string. I.E. mIRC v6.12 Khaled Mardam-Bey is not the same as mIRC v6.12 Khaled mardam-Bey
- Must have exact string matching. mIRC v6.12 Khaled Mardam-Bey is not the same as mIRC v6.12 Khaled-Mardam-Bey
- must only allow mIRC versions of 5.91 through 6.12

Thanks for your help if you can help!

Re: Real quick Help #61960 27/11/03 07:48 AM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Code:
on *:CTCPREPLY:version*: {
  if ($regex($2-,/^mIRC v[5.91]|[6.1]|[6.11]|[6.12] Khaled Mardam-Bey$/)) { 
    do stuff 
  }
}


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: Real quick Help #61961 27/11/03 12:42 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Character classes match a single character (hence their name), not a string.
[5.91] matches "5" or "." or "9" or "1"
(?:5\.91) matches "5.91"
You'd have to use something like
Code:
/^mIRC v(?:5\.91|6\.(?:0[1-3]?|1[12]?)) Khaled Mardam-Bey$/


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Real quick Help #61962 05/12/03 10:23 PM
Joined: Dec 2002
Posts: 44
G
GodGell Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Dec 2002
Posts: 44
it would be a simple

^mIRC v(5.91|6.1|6.11|6.12) Khaled Mardam-Bey$


sorry for my bad english
watch out when you're in front of my scalar howitzer smile

Punks not dead!
Re: Real quick Help #61963 05/12/03 10:25 PM
Joined: Dec 2002
Posts: 44
G
GodGell Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Dec 2002
Posts: 44
or

^mIRC v[3-6].[0-9]([0-9)? Khaled Mardam-Bey$


sorry for my bad english
watch out when you're in front of my scalar howitzer smile

Punks not dead!
Re: Real quick Help #61964 05/12/03 10:54 PM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
1st exp) Not correct, firstly because these are not the only versions the expression should match, secondly because you didn't escape the '.' chars..

2nd exp) This is just the opposite, matches a lot more, even versions that don't exist at all, like 6.69 - you don't need the group there btw

qwerty's expression is pretty simple already, provided that you know a little regex..

Last edited by cold; 05/12/03 10:57 PM.

* cold edits his posts 24/7