Solved! Go to Solution.
MYCAPTION.match(/\d{10}/)[0]
extracts a 10-digit number from the variable MYCAPTION.
Let's see an example of your caption string.
Is the number always in the same position in the string or is the "Motor - Ad" part a random size?
Will there be any other numbers before the 10 digit one?
What I did for something similar was to use aqString.Trim to get all the spaces out of the string and then loop through it a character at a time looking for a digit. That will get you the position of the first digit. Then you can use aqString.Substring to get the 10 digits.
I never found a way to use the regular expressions for this. Looks like you can use them to compare but not for string manipulation.