How to use substr in macros.txt?

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

Moderator: Moderators

Post Reply
Message
Author
blodycandy
Noob
Noob
Posts: 5
Joined: 20 Jun 2017, 14:26
Noob?: Yes

How to use substr in macros.txt?

#1 Post by blodycandy »

hello,
I need get third number from a lot of number

There are 10 random numbers,Every time is different

^5613265165

^2153261952

I found information about perl Function substr can help me get number

but how to use substr in macros.txt?

I tried like this:

automacro pp {
exclusive 1
run-once 1
map geffen
console /: \^(.*)/
call {
log $.lastMatch1
$aa = $.lastMatch1
$bb = @eval(substr($aa),3,1)
release all
stop
}
}

but not work,please help me,thanks before

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 151
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: How to use substr in macros.txt?

#2 Post by c4c1n6kr3m1 »

understand this pattern
http://jkorpela.fi/perl/regexp.html

console /\d\d(\d)\d\d\d\d\d\d\d/

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

Re: How to use substr in macros.txt?

#3 Post by gamenikko »

Just plain

Code: Select all

/\d/
would be enough.
Just like old times.

Post Reply