adding multiline support for memories by replacing `.` with `[\S\s]` matching

group to match new lines, since `.` doesnt match new lines in JavaScripts
implementation of RegEx