0

I have members emailing in for support instead of using the online support form and they are nice enough to put their Member ID into the Subject line. I would like to extract these Member ID from the Subject line to populate the Member ID field for the support ticket.

At the moment, I am able to use something like below to find the tickets where the Subject line has the string pattern which I am looking for (7 numbers in a row). My difficulty now is how to extract these numbers from the Subject line.

SELECT t.ID, `Subject`
FROM tickets AS t
WHERE `Subject` REGEXP '[1-6][0-9][0-9][0-9][0-9][0-9][0-9]';

I have attempted to use the Strip Non Digit function from here, however, the Subject line may contain other numbers that are not part of the Member ID. How can I extract just the number block that matches that regex?

Community
  • 1
  • 1
KuroNeko
  • 101
  • 1

0 Answers0