[Solved] Auto create links in text following a pattern [closed]

[ad_1]

simple regexp approach

document.body.innerHTML = document.body.innerHTML.replace(/(\d{4}\/\d{1,3})/g, 
  '<a href="http://example.com/something-$1">$1</a>')
Some text 0000/0 and this 1234/56 and that  7777/666

4

[ad_2]

solved Auto create links in text following a pattern [closed]