hi there
I am wanting to extract sku code from image url that has two patterns.
In the first case the image url ending pattern is as follows
/images/uploads/19113604-5.jpg
/images/uploads/19113604-4.jpg
/images/uploads/19113604-3.jpg
and I use regex
(?<=\buploads/)(\w+)
$1
this results in
19113604 which is what I want. However, in the second case the image url ending patter is
/images/uploads/DD-19113604-5.jpg
/images/uploads/DD-19113604-4.jpg
/images/uploads/DD-19113604-3.jpg
and I want to return DD-19113604 but the above regex results in just "DD".
I have tried
((?<=\buploads/)(\w+\-\w+))|((?<=\buploads/)(\w+))
$1
this does result in the expected DD-19113604 for the second case but does not work for the first case as it looks "DD-" can't find it and then stops.
I would great appreciate any help with this
thanks