My goal is to use Regex to extract from an HTML document the value of a tag with a specific name. The relevant part of the code is:
<!-- hidden datas -->
<p class="hidden">
<input type="hidden" name="token" value="6ac2c9b7d56b483ad6b9db051a285637" />
<input type="hidden" name="id_product" value="541" id="product_page_product_id" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="id_product_attribute" id="idCombination" value="" />
</p>
I'll need to extract the alphanumerical characters 6ac2c9b7d56b483ad6b9db051a285637 Unfortunately, there is no other way than via Regex.
The same token is also present in another part of the document. Maybe it's easier to extract in that block of code?
<script type="text/javascript" src="/webshop/js/tools.js"></script>
<script type="text/javascript">
var baseDir = '/webshop/';
var static_token = '6ac2c9b7d56b483ad6b9db051a285637';
var token = '1799f145490151b92137df1493a520cc';
var priceDisplayPrecision = 2;
</script>