Replace links in strings with the JS replace method and callback functions

preview_player
Показать описание
Continuing from my previous video where I explained how to use the replace method with callback functions, in this video, I show a use case for that replacement approach.

I show how to replace links in strings, and how to style those links differently.

_____

_____

🌟 About Me:
Dillion Megida, creator of DEEECODE, is a Software Engineer, Developer Advocate and a Content Creator passionate about simplifying topics around Tech via articles and videos.

_____

⚡️ Connect with me:

_____
#deeecode
Рекомендации по теме
Комментарии
Автор

(Google translate) I saw the two videos of the replace method, but I would like to know how I can choose the replacement value depending on the match.
Example: for a regex=/[1234]/.
String = "I'm turning 11 and in 2024"
1 to a
2 to b
3 to c
4 to d
would result "I'm turning aa and in b0bd"
Chat gpt gave me a solution but I can't find documentation for it

razareza
join shbcf.ru