We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I don't think this task teaches responsible use of regex.
HTML literally can't be parsed this way - not unless you give up completely on matching opening and closing tags. Even if you can get away with it this time (let's assume links never get nested, and never contain additional markup), it's bad practice.
Teaching people to use regular expressions for this is responsible for the majority of bad parsing code on the web.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Detect HTML links
You are viewing a single comment's thread. Return to all comments →
I don't think this task teaches responsible use of regex.
HTML literally can't be parsed this way - not unless you give up completely on matching opening and closing tags. Even if you can get away with it this time (let's assume links never get nested, and never contain additional markup), it's bad practice.
Teaching people to use regular expressions for this is responsible for the majority of bad parsing code on the web.