'how can get part of link very important

how can i get from this link http://127.0.0.1:4000/resetPassword/3067a7a5b300f90ee593508647a7dbf7aa38a47b15808e69aa8b5421ea0f1408 the number after resetPassword/ can any one help me??



Solution 1:[1]

const str = 'http://127.0.0.1:4000/resetPassword/3067a7a5b300f90ee593508647a7dbf7aa38a47b15808e69aa8b5421ea0f1408';

const regex = /(?<=resetPassword\/).+/;
const result  = str.match(regex);
console.log(result?.[0]);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bilbo baggins