JSFiddle - React, Tailwind, and code Playground
by Evgeniy Kvasyuk
JavaScript
const inputJson = {
"name": "test",
"url": "https://www.example.com",
"nested": {
"name": "nested",
"url": "https://www.nested.com",
"text": "Check this link: https://www.check.com"
},
"array": [
"https://www.array.com",
{ "name": "arrayItem", "url": "https://www.arrayItem.com" }
]
};
const urlRegEx = /https?:\/\/[^\s]+/g;
console.log(JSON.stringify(inputJson));
console.log(JSON.stringify(inputJson).match(urlRegEx));