Extract parts of a string

Hi everyone,

Im trying to extract part of a string that has 5 consecutive numbers.
Can someone please suggest how this could be done?

like in this product name "LEGO Star Wars At-At - 75054" I want to extract 75054
this 5 digit code could be anywhere in the string and doesn't necessarily follow hyphen(-).

these are some example URLs where Im looking the do the scraping

any help is appreciated

Regex '\d{5}' should do the trick.

But that will match part of a longer series of digits. To match exactly 5 digits, you need negative lookbehind and negative lookahead. Try this regex instead: (?<!\d)\d{5}(?!\d)