Test, validate and match regular expressions
This regular expression matches magnet links commonly used for peer-to-peer file sharing. It looks for the string "magnet:" followed by typical URL characters like alphanumeric symbols, query parameters (?xt=...), and encoded characters. The "g" flag enables a global search to find all occurrences in the given text, while the capturing group extracts the full magnet URI. It is useful for parsing text to extract downloadable torrent links.