Remove specific text & numbers using shortcuts

Hi, I’m looking to remove text using shortcuts.
My list in shortcuts looks like below-

Product pm1.25 - 123456

I want to remove product pm1.25 but keep 123456
hopefully someone can help.

Thank you

Sounds like you need a regular expression.
The attached matches all numbers after the dash and space, then speaks the number.

So what I’m trying to do is put together a list of products then email this list of to someone just leaving the 6 digit codes. I’m using the description to put together an order then removing the description. But I can’t Figure out how to remove the description and the pm1.25. I have attached screenshots of what my shortcut is currently.

The match text and get item actions I posted will get rid of everything except the part number. You can create those actions in your own shortcut. Or maybe I’m not understanding what you’re wanting to do.

Hi, no I ended up figuring it out is used \d{6,6} to get the 6 digit number then I was able to pass it onto an email. Thank you very much for your help I would never have thought of using match text instead of replace text. Your way is a lot more efficient.

1 Like