regular expression: can't understand this one

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

unknown player
Noob
Noob
Posts: 17
Joined: 01 Aug 2009, 13:06
Noob?: Yes
Location: Somewhere near the river

regular expression: can't understand this one

#1 Post by unknown player »

good day, please help me understand this regexp..copied it from a buffer macro..and how to assign $.lastMatchN..thanks..

what does \\[(.*)=(.*)\] (.*) \((\d+)\): (.*)(heal|kyrie)(.*)$means?

Code: Select all

console /\[(.*)=(.*)\] (.*) \((\d+)\): (.*)(heal|kyrie)(.*)$/

$dist = $.lastMatch2
$i = $.lastMatch4
$com = $.lastMatch6
Image
unknown player
Noob
Noob
Posts: 17
Joined: 01 Aug 2009, 13:06
Noob?: Yes
Location: Somewhere near the river

Re: regular expression: can't understand this one

#2 Post by unknown player »

help pls!
Image
rocknroll
Been there done that!
Been there done that!
Posts: 118
Joined: 19 Sep 2011, 07:30
Noob?: Yes

Re: regular expression: can't understand this one

#3 Post by rocknroll »

use search function in this forum, or search on google with keyword regex perl :lol:
Sorry, my english is very bad !
unknown player
Noob
Noob
Posts: 17
Joined: 01 Aug 2009, 13:06
Noob?: Yes
Location: Somewhere near the river

Re: regular expression: can't understand this one

#4 Post by unknown player »

rocknroll wrote:use search function in this forum, or search on google with keyword regex perl :lol:

i did search but couldn't understand it..would you mind explaining it to me?especially on how to assign $.lastMatch with console has number and text in it..
Image
rocknroll
Been there done that!
Been there done that!
Posts: 118
Joined: 19 Sep 2011, 07:30
Noob?: Yes

Re: regular expression: can't understand this one

#5 Post by rocknroll »

i guess, you did not search it.
maybe this can help you to be a diligent person :?

Image
Sorry, my english is very bad !
unknown player
Noob
Noob
Posts: 17
Joined: 01 Aug 2009, 13:06
Noob?: Yes
Location: Somewhere near the river

Re: regular expression: can't understand this one

#6 Post by unknown player »

rocknroll wrote:i guess, you did not search it.
maybe this can help you to be a diligent person :?

Image

wow, where did you get this sir?can you please share the link..i did search sir for lectures about regexp but sadly, i don't understand it..the only thing i get is that "\d or \d+" pertains to digits..T_T..thank you sir for the illustration..sir, what would the exp "(.*)" in the beg and end of the word trigger means?
Image
rocknroll
Been there done that!
Been there done that!
Posts: 118
Joined: 19 Sep 2011, 07:30
Noob?: Yes

Re: regular expression: can't understand this one

#7 Post by rocknroll »

unknown player wrote:sir, what would the exp "(.*)" in the beg and end of the word trigger means?
it work when u say "ahealb", or "asdasdasdasa1222233kyriezzzzeeeezzzz". that's mean any word at the beginning or at the end.
Sorry, my english is very bad !
unknown player
Noob
Noob
Posts: 17
Joined: 01 Aug 2009, 13:06
Noob?: Yes
Location: Somewhere near the river

Re: regular expression: can't understand this one

#8 Post by unknown player »

rocknroll wrote:
unknown player wrote:sir, what would the exp "(.*)" in the beg and end of the word trigger means?
it work when u say "ahealb", or "asdasdasdasa1222233kyriezzzzeeeezzzz". that's mean any word at the beginning or at the end.
ah i see..thanks sir..but how about triggering word coming from npc..can i do this: console /\(.*)\: (.*)heal|kyrie(.*)$/ and with this my $.lastMatch would be numbered as 2..am i right sir?thank you for answering my question sir..^_^

Image[/quote]
Image