I can't seem to find a way for a javascript regex to match on the whole text, and not line by line. I'd like that the regex engine do not regard '\n' as the end of the text, but as a character like any other.
Here's an example of the problem:
var string = "Aaa\nbb";
console.log(/^A(.*)/g.exec(string)[1]);
Result in the console:
aa