Regular Expression for numerical values

Hi everyone. I am trying to use regular expression to extract numerical values from a conversation and store them separately into different columns in google sheets but I am only able to get the correct output for PROD. See below example:

Step1:
Conversation: "Hi. I would like to order PROD12345 with QTY10.

Step2:
Google Sheet :

±--------------±----------------±--------------+
| Customer | Product_Code | QTY |
±--------------±----------------±--------------+
| John Doe | 12345 | 10 |
±--------------±----------------±--------------+

Quantity Regex: “.QTY(.\d)+”)
Output: 10 → Correct

Product_Code Regex: “.PROD(.\d)+”)
Output: 123 QTY10 → Incorrect. Should only show the value for PROD.

Is there a way I can only get the value for PROD?

Many thanks!

Try something like this instead,

(?<=PROD)\d+

2 Likes