I am very new to regex and I'm not sure how to pluck a piece of test from a very large string using regex.
suppose the string is this: FYI: This string would be generated dynamically pulling different elements from the database and the dom. I don't have much control on how it gets created.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptas architecto dicta amet cumque, atque, labore eos nobis earum fuga tempore officiis excepturi rerum placeat. Perferendis, earum officiis veniam dicta eius aliquid, similique porro quam necessitatibus nobis velit debitis.
<span itemprop="itemNum">56789</span>
labore eos nobis earum fuga tempore officiis excepturi rerum placeat. Perferendis, earum officiis veniam dicta eius aliquid, similique porro quam necessitatibus nobis velit debitis.
I need to get the text inside the span that has an itemprop labeled itemNum.
I tried this but it did not work for me:
/\b(itemprop=\"sku\"")\b/g
Ultimately I would have only 56789 in a variable.
Thank you all in advance.