I'm looking to get this value 'B00DS4KJR4' enclosed in tags from a url by using file_get_contents() function in PHP. However, I'm failing to write the correct regex to find the value from this html source code the page:
<span class="a-text-bold">ASIN:
</span>
<span>B00DS4KJR4</span>
Can you help me to write the correct regex to find that particular value on the page ?
You can use a regular expression like the following also presented on Regex101. This looks for a
<span>
with any attributes, containing the stringASIN:
in the innerHTML followed by another<span>
and captures the contents of the second<span>
.