In general, yes, you need one regular expression for the whole letter, but this is about one entity, that is, for goods you write a common regular expression, starting from the very first character in the text.
There are also different modifiers, they help to process the content, because there are a lot of nuances here.
Here is a service where you can test
https://regex101.com, it can only find the first element, then it doesn’t work anymore because it picks up modifiers, I don’t know how to do it without them.
it was:
p\sclass="text-left code".*?>[#product_articul]\s.*?<\/p>\n\W*p\sclass="name".*?>[#product_name]<\ /p>\n.*<\/th><\/tr><\/tbody><\/table><\/th>\n.*<th\sclass="small-3\slarge-2\ scolumns".*?><table.*?><tbody><tr.*?><th.*?>\n\W*p\sclass="quantity".*?>[#product_count]\s. *?<\/p>\n.*?<\/th><\/tr><\/tbody><\/table><\/th>\n.*?<th.*?><table .*?><tbody><tr.*?><th.*?>\n\W*p\sclass="price".*?<\/p>\n\W*p\sclass="one_price ".*?>[#product_price]\s.*?<\/p>
So it became:
<tbody>.*?<p\sclass=\"text\-left\scode\".*?padding:\s0\; text\-align\:\sleft\;\">[#product_articul]\s.*?<\/p>.*?<p\sclass="name".*?padding:\s0\; text\- align\:\sleft\;\">[#product_name]<\/p>.*?<p class="quantity".*?padding:\s0\; text\-align\:\sright\;\">[#product_count]pcs*?<p class="price".*?padding:\s0\; text\-align\:\sright\;\"> [#product_price]USD
+ modifier
And this is for checking in the service
<tbody>.*?<p\sclass=\"text\-left\scode\".*?padding:\s0\; text\-align\:\sleft\;\">(.*?)\s.*?<\/p>.*?<p\sclass="name".*?padding:\s0\; text\ -align\:\sleft\;\">(.*?)<\/p>.*?<p class="quantity".*?padding:\s0\; text\-align\:\sright\;\">(.*?)piece*?<p class="price".*?padding:\s0\; text\-align\:\sright\;\" >(.*?)UAH
Finds
Just regular was wrong