I have URLs like below with customer ID etc. I want to remove them and put an asterisk instead of them. Below examples will give you a better idea.
/paas/service/3.0/part/d878bc1e-9bb8-4a0e/log/account/7367c100-9390-11e3/resource/AdminHistory --> /paas/service/3.0/part/*/log/account/*/resource/AdminHistory
/hs/service/3.0/bootstrap/mnd/3388959354 --> /hs/service/3.0/bootstrap/mnd/*
/paas/service/3.0/part/d878bc1e-9bb8-4a0e-b224-a4ba0d7dfcec/asset --> /paas/service/3.0/part/*/asset
/paas/service/3.0/part/3c5631df-52c9/servicepolicy/8ee6ba08-8d7a/carrierPlan/c2b4a364-98e3-4546 --> /paas/service/3.0/part/*/servicepolicy/*/carrierPlan/*
The IDs are either numeric or alphanumeric. How should i approach this ?
url.replace(new RegExp(id, 'g'), '*').