I have a URL that includes a product ID which can be in the following format:
One alphabetical letter followed by a number of any number of digits, then an underscore, and then any number of digits and underscores.
So this is a valid product id: c23_02398105
and so is this: c23_02398105_9238714
.
Of course in a URL, it's sandwiched between other query string items, so in this url, i want to extract just the id:
http://www.mydomain.com/product.php?action=edit&id=c23_02398105&side=1
I've been trying a regex something along the lines of this, to no avail:
/&id=[a-z]_[(0-9)*]&/
What's the correct way to extract the product id?