[Expression true?] Is there an expression 'contains'?

1,015 views
Skip to first unread message

joshua...@gmail.com

unread,
Jun 25, 2017, 8:50:57 AM6/25/17
to Automate
Basically, I'm searching for a way to make the block search for a 6-digit code in a certain text message.

Thanks.

joshua...@gmail.com

unread,
Jun 25, 2017, 9:07:54 AM6/25/17
to Automate, joshua...@gmail.com
It's supposed to be searching like "if {message} [contains] {some expression for '6-digit code'}". Is that even possible?

Rob Lund

unread,
Jun 25, 2017, 1:18:48 PM6/25/17
to Automate, joshua...@gmail.com
I'd like something similar.  I'm trying to find certain kinds of keywords in a calendar event.

Henrik "The Developer" Lindqvist

unread,
Jun 25, 2017, 2:14:37 PM6/25/17
to Automate, joshua...@gmail.com

joshua...@gmail.com

unread,
Jun 26, 2017, 11:36:57 AM6/26/17
to Automate
Okay, got that now, but is there a way to make it search for a value with always changing numbers (1. 539205 2. 352969 3. 701403 etc.)?

Henrik "The Developer" Lindqvist

unread,
Jun 26, 2017, 2:07:23 PM6/26/17
to Automate, joshua...@gmail.com
findAll(text, "([0-9.]+)")

On Monday, June 26, 2017 at 5:36:57 PM UTC+2wrote:
Message has been deleted

joshua...@gmail.com

unread,
Jun 27, 2017, 10:04:00 AM6/27/17
to Automate
(Sorry for replying so late) Alright, that system works now. Unfortunately, my senders updated their messages so that they now include a support mobile number to call. Is there a way to have the expression only search for 6-digit numbers?
EDIT: Also, can you somehow extract the number and assign it to a variable (either directly with that block, what I doubt, or with [Variable set])?

Henrik "The Developer" Lindqvist

unread,
Jun 27, 2017, 4:10:18 PM6/27/17
to Automate, joshua...@gmail.com
Use the variable set block with "value" as:
findAll(text, "(\\d\{6})")[1]

joshua...@gmail.com

unread,
Jun 27, 2017, 4:32:39 PM6/27/17
to Automate
Right, thanks. Is there a detailed explanation somewhere referring to the [1] and the other characters like '/'?

Henrik "The Developer" Lindqvist

unread,
Jun 27, 2017, 10:46:56 PM6/27/17
to Automate, joshua...@gmail.com
Reply all
Reply to author
Forward
0 new messages