from the /g at the end (and the spaces on the edges) i agree it looks like a malformed attempt at an awk/perl/etc substitution
The /g at the end is the global operater. It means, roughly, match across the entire input string.
This is completely valid regex, not a malformed attempt at anything. It’s just that the delimiters and operators are often omitted from regex in practical use so you may not be used to seeing them.
yeah, i edited my comment while you were replying to note that /g is a valid flag for m/// as well. it is a valid perl matching operation precisely as-is but it can’t match anything due to the spaces it has before the ^ and after the $.
The /g at the end is the global operater. It means, roughly, match across the entire input string.
This is completely valid regex, not a malformed attempt at anything. It’s just that the delimiters and operators are often omitted from regex in practical use so you may not be used to seeing them.
yeah, i edited my comment while you were replying to note that
/gis a valid flag form///as well. it is a valid perl matching operation precisely as-is but it can’t match anything due to the spaces it has before the^and after the$.