mIRC Home    About    Download    Register    News    Help

Print Thread
#265908 12/08/19 04:44 PM
Joined: Feb 2015
Posts: 138
kap Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Feb 2015
Posts: 138
Code
alias test {
  var %text {"coord":{"lon":3.57,"lat":51.46},"weather":[{"id":310,"main":"Drizzle","description":"light intensity drizzle rain","icon":"09d"},{"id":521,"main":"Rain","description":"shower rain","icon":"09d"},{"id":200,"main":"Thunderstorm","description":"thunderstorm with light rain","icon":"11d"}],"base":"stations","main":{"temp":16.66,"pressure":1014,"humidity":72,"temp_min":15,"temp_max":18.89},"visibility":10000,"wind":{"speed":5.7,"deg":270},"clouds":{"all":100},"dt":1565618207,"sys":{"type":1,"id":1553,"message":0.0087,"country":"NL","sunrise":1565583963,"sunset":1565637345},"timezone":7200,"id":2745392,"name":"Vlissingen","cod":200}
  var %pattern /(\d+)/g
  var %subtext $chr(3) $+ 07\1 $+ $chr(15)
  echo -a $regsubex(%text,%pattern,%subtext)
}


[Linked Image from i.imgur.com]

Running this on a vanilla version 7.57...

What am I doing wrong?

edit: https://regex101.com/r/bLJWT4/1

Last edited by kap; 12/08/19 05:04 PM.

GNU Terry Pratchett - Looking for a mIRC help channel -> Check #mircscripting @ irc.swiftirc.net
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Looks like mIRC is the one doing it wrong

Code
//echo -a $regsubex(a1b,(\d+), this one is fine: \1 - still fine: c\1d - bug??: $chr(3) $chr(3) 07\1)
- the bug doesn't occur because the color sequence is ended

Code
//echo -a $regsubex(a1b,(\d+), this one is fine: \1 - still fine: c\1d - bug??: $chr(3) 07\1)
- the bug shows up, $+ not even required
scratch that, that was huge non sense!

The markers (\1 here) have to appear literaly in the subtext parameter of $regsubex.

Last edited by Wims; 12/08/19 06:21 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2015
Posts: 138
kap Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Feb 2015
Posts: 138
Thanks! You're right, it's working now!


GNU Terry Pratchett - Looking for a mIRC help channel -> Check #mircscripting @ irc.swiftirc.net

Link Copied to Clipboard