Tag: code-snippet
-
Named capturing groups in regex
Regular expressions, commonly known as regex, are a super powerful tool that can be used for search, filtering, string manipulation and validation. Even though there are some syntax variations, regex can be used with most software languages. This article will focus on a particularly handy part of the regex syntax that can make your code…
-
Copy HTML content with navigator clipboard
We have often seen “Copy” buttons for plain text. Thanks to navigator.clipboard‘s API, we can also programatically copy and paste HTML content. The copy code Let’s imagine we have a bit of HTML content that includes links and other basic HTML code. We want our end users to be able to copy it exactly as…