Extract URL value if has sku in the url

I am having a url like
http://192.168.1.5/wpp/base/product/sku/4t4tsdg

if sku word is present in the url i need need to extract the value 4t4tsdg using regex. i am using in wordpress

Read More

i tried using /product/sku/(.*/?)$ but unable to get it

php code i used in wordpress

add_rewrite_rule('/product/sku/(.*/?)$', 'index.php?product_sku=$matches[1]', 'top');

Related posts