mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 3 1 2 3
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Yes, I overlooked the feasibility of using a var.

The fact remains, the on text regex has no escape sequence, and we either need to use hex or octal to escape certain characters.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Quote:
the on text regex has no escape sequence, and we either need to use hex or octal to escape certain characters.
The bold part doesn't make sense confused (it's understood though) but that last statement is not true, the only thing we need to do is by passing the way mirc parses a code.
Using hex or octal to match a colon inside the matchtext of an event's definition because you used the $ prefix is one solution, but you could also not use the $ prefix and use $regex without any hex or octal, I just wanted to make that clear.

Last edited by Wims; 29/04/11 10:39 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Wims, what I was trying to say is this:

Quote:
on $*:text:/http:///Si:#:{
This will not match http:// It doesn't matter if you escape the colon character as \:

Quote:
on $*:text:/http\x3A///Si:#:{
By using \x3A, this regex will match http:// without a problem.

This does not apply to the use of $regex()

Last edited by Tomao; 30/04/11 12:44 AM.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I know what you were trying to say:
Quote:
The bold part doesn't make sense (it's understood though)
It's just that it's not about regex, you can't match a litteral colon inside the matchtext on an event, regex or not.
Your statement was then implying that octal or hex was the only solutions, as I said I just wanted to make it clear that it wasn't
Quote:
you could also not use the $ prefix and use $regex without any hex or octal, I just wanted to make that clear.

Note: you don't need to escape a colon in regex anyway

Last edited by Wims; 30/04/11 01:11 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Yes, I had the interpretation of "escape sequence" misunderstood and misconstrued. I learned that from this post initially, and I quote:

Why not escape it:
Code:

/^!foobar\:\S+/

Then you make the colon sign literal so it won't be associated with regex's special meaning.

Wiz126 replied:

This has nothing to do with regex, in fact he wants it to work with regex, not escape it. Like I said in my previous post its the way mIRC parses the event, also there is no escape sequences for match texts.

If you have something like: on $*:text:/^!foobar (?\:\S+)/:#:{

mIRC will parse is into "$*", "text", "/^!foobar (?\", "\S+)/", "?"
notice, at that point your matchtext is broken, this is done way before the matchtext is even being matched. as a result you simply cannot have colons in the matchtext at all.

Edited by Wiz126 (15/03/11 08:03 PM)

I really need to get with the program.

Joined: Dec 2010
Posts: 26
L
LMN Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2010
Posts: 26
But now I use:

Code:
/set %FCToken1 $gettok(%sockreader,1,40) | echo -a %FCToken1 | echo -a $gettok(%FCToken1,1,39)

It returns:
Code:
<span class="title">Knudde op vakantie</span><span class="cat">Maandag</span>
-
* /echo: insufficient parameters (line 22, script5.ini)
-
<span class="title">Robben: Bayern mist een echte leider</span><span class="cat">Vrijdag</span>
-
* /echo: insufficient parameters (line 22, script5.ini)
-
<span class="title">Echte voetbal zegeviert</span><span class="cat">Donderdag</span>
-
* /echo: insufficient parameters (line 22, script5.ini)
-
<span class="title">Ferguson lyrisch over Neuer</span><span class="cat">Woensdag</span>
-
* /echo: insufficient parameters (line 22, script5.ini)
-
<span class="title">Ajax laat Dost vallen en wil Matavz</span><span class="cat">Dinsdag</span>
-
* /echo: insufficient parameters (line 22, script5.ini)
-
<span class="title">Bayern wordt steeds gezelliger</span><span class="cat">Vrijdag</span>
-
* /echo: insufficient parameters (line 22, script5.ini)
-
<span class="title">Real Madrid verslaat Barcelona</span><span class="cat">Donderdag</span>
-
* /echo: insufficient parameters (line 22, script5.ini)
-
<span class="title">Van der Wiel voor 10 miljoen naar Bayern</span><span class="cat">Woensdag</span>
-
* /echo: insufficient parameters (line 22, script5.ini)

The /tokenize command didn't work. But this is not what I want, I want
Code:
/fc-knudde/1000709/popup.html
out of
Code:
<a href="#" onclick="NU.popup('/fc-knudde/1000709/popup.html','Cartoon','480','730'); return false;">

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Quote:
But this is not what I want, I want

/fc-knudde/1000709/popup.html

out of

<a href="#" onclick="NU.popup('/fc-knudde/1000709/popup.html','Cartoon','480','730'); return false;">
$gettok(string,2,39)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2010
Posts: 26
L
LMN Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2010
Posts: 26
Oh, it's a bit dumb that I didn't think of that myself smile
Thank you all very much, I have my final script now.

Page 3 of 3 1 2 3

Link Copied to Clipboard