((\d+)\)

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
pacoid
Noob
Noob
Posts: 3
Joined: 26 Nov 2010, 17:44
Noob?: No

((\d+)\)

#1 Post by pacoid »

What does ((\d+)\) do? I tried google, and openkore.com but there is no explanation.

Code: Select all


automacro dimagic {
console /Player (.*) \((\d+)\) uses (.*) on you - Dmg.*/i
call {
do kill $.lastMatch2
}
}


gamenikko
The Way Of Human
The Way Of Human
Posts: 192
Joined: 16 Aug 2009, 03:47
Noob?: Yes
Location: Gonryun

Re: ((\d+)\)

#2 Post by gamenikko »

What does ((\d+)\) do? I tried google, and openkore.com but there is no explanation.

It means any character, \((.*)\) it's just the same with this. Just correct me if I'm wrong.
Just like old times.

User avatar
kLabMouse
Administrator
Administrator
Posts: 1301
Joined: 24 Apr 2008, 12:02

Re: ((\d+)\)

#3 Post by kLabMouse »

\d -- Any Decimal (one char)
\d+ -- Any Number
(\d+) -- group -> $1 if found.
\( and \) -- inside ()

so \((\d+)\) will match something like "(1234567890)" without " ofc. =)

It's called RegExp. Google for "Perl RegExp".

Locked