Just looking at results from regex101, I am trying a fairly simple test:
Match /^\\s+a/ (notice no g or m flags) against
/^\\s+a/
g
m