Skip to content
Advertisement

ignoring img tags while searching for urls in string

I have the following code in which I am replacing urls with hyperlinked anchor tags,

JavaScript

But I want to ignore all img tags while searching for urls, I have no idea how can I go for it.

Advertisement

Answer

As per @Biesor and @Nigel Ren I came up with this,

JavaScript

For the time being I am using this till some better solution comes up.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement