mIRC Home    About    Download    Register    News    Help

Print Thread
#24997 19/05/03 03:19 AM
S
ScatMan
ScatMan
S
can any1 tell me what does //x in regex and if u can so //s too

#24998 19/05/03 07:27 AM
A
aarrgghh
aarrgghh
A
Check the numerous of regex tutorials that floats around on the internet.

#24999 19/05/03 10:58 AM
S
ScatMan
ScatMan
S
thank you, any1 else ??

#25000 19/05/03 11:10 AM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
//x makes regex ignore any whitespaces in the pattern. Example:
$regex(abc,/a b c/) -> 0
$regex(abc,/a b c/x) -> 1

//s makes the dot ( ".") match the LF character (char 10) too. By default, the dot matches every character except LF. Example:
$regex($lf,/./) -> 0
$regex($lf,/./s) -> 1

Seeing that most people vaguely recommend tutorials and stuff, I'd like to point out that it matters WHICH tutorial/manual you choose. mirc uses the PCRE library for regular expressions, so to learn all about mirc regex, one has to read the PCRE manual, not Perl/php/vbscript or whatever manual on regexes. For basic stuff, all these are ok, but your question is a good example of why the PCRE manual is necessary. Here it is

#25001 19/05/03 01:15 PM
S
ScatMan
ScatMan
S
ok i will try to read him, and thx

#25002 19/05/03 01:23 PM
S
ScatMan
ScatMan
S
hmm... but, why do i need to use //x if i can use:
$remove(...,$chr(32))


#25003 19/05/03 01:27 PM
A
Anonymous
Anonymous
A
uh huh

#25004 19/05/03 05:17 PM
Joined: Dec 2002
Posts: 168
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 168
It's there so you can make your pattern more readable. Why use $remove when you can smash it all together. I never use //x but then again I don't use $regex very often.

#25005 20/05/03 04:48 AM
Joined: Feb 2003
Posts: 308
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 308
because regex isn't a mIRC invention - other languages don't have a $remove that functions just like mIRC's, and it makes a more readable regex pattern (hello oxymoronville)

#25006 20/05/03 06:58 AM
S
ScatMan
ScatMan
S
hmm, there is a problem in that, i found out that it removes other chars except space

#25007 21/05/03 02:22 AM
Joined: Dec 2002
Posts: 698
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 698
It also removes (ignores) #comments (preceded by "#"), therefore will remove #channel along with #comment.


Link Copied to Clipboard