How to add variable in the pattern of regex? I am looking through email body to find a price of an item and it works if I test it with specific item. But I need it to work with a variable as the item will be a different each time. At the moment just testing with some random string
when I use following pattern (?:someitem)\s+[\w ]+\S*\d+\S* it works fine but when adding the variable ‘newtext’ it will not work.