How to get details after a certain text in sms?

Im working now for a project called Cashless transaction using sms , wherein when someone paid there bill, mikrotik will automatically look for its account number and Reference number, the problem is I dont know how to code the specific string on the sms.

Ex. Text SMS

You have received PHP 1.00 of GCash from JO**E J* P. 09537424754 w/ MSG: 2021001. Your new balance is PHP 24.00. Ref. No. 6007722478141.

I do like to get the “MSG: 2021001” and also the “Ref No. XXXXXXXXXXX” which is randomly generated. by the user.

I did some research on PHP language, but i i could make it happen on ROS ,

Here’s the sample PHP Code

<?php $string="admin wrote a new post, FIRE 2 days, 2 hours ago"; $result=preg_split('/post,/',$string); if(count($result)>1){ $result_split=explode(' ',$result[1]); print_r($result_split[1]); } ?> \ \ Please do help, thankyou

anyone to help ?

I dont get ur questions actually,
something like this?

:local smss "You have received PHP 1.00 of GCash from JO**E J* P. 09537424754 w/ MSG: 2021001. Your new balanc
e is PHP 24.00. Ref. No. 6007722478141.";

:log warning [:pick $smss [:find $smss "MSG:"] [:find $smss " Your"]];
:log warning [:pick $smss [:find $smss "Ref."] [:len $smss]];

Not well done…

{
:local smss "You have .... 37424754 w/ MSG: 2021001. Your new ... Ref. No. 6007722478141.";

# Only the numbers:
:put [:pick $smss ([:find $smss "MSG: "] + 5) [:find $smss ". Your new"]]
:put [:pick $smss ([:find $smss "Ref. No. "] + 9) ([:len $smss] - 1)]

# also with test before
:put [:pick $smss [:find $smss "MSG: "] [:find $smss ". Your new"]]
:put [:pick $smss [:find $smss "Ref. No. "] ([:len $smss] - 1)]
}

Thankyou sir Rextended , so much appreciated, ive been working this for wk now, thankyou so much!

Also thankyou sir zainarbani , so much appreciated too!