What regex flavor does Notesnook use?

Notesnook's regex engine is based on

- **Case-sensitivity:** By default, it is case-sensitive, though this can be toggled in the Find and Replace dialog.

- **Multiline mode (`m` flag):** In JavaScript regex, the `m` flag makes the `^` and `$`anchors match the start and end of *each line* rather than the start and end of the entire string.

- **Line breaks:** The `\n` escape sequence is used for a new line, but its interpretation can depend on the operating system. Using the actual line break character in the "Replace" field is a robust workaround if `\n` doesn't work as expected.

- **Capture groups:** Standard parentheses `()` create a capture group, and these can be referenced in the replacement string using `$1`, `$2`, etc..

- **Lookaheads and lookbehinds:** JavaScript regex supports both positive lookaheads `(?=...)` and negative lookaheads `(?!...)`. While lookbehinds `(?<=...)` were not available in older versions, they are supported in newer ECMAScript standards.

The primary reason for the `\n` issue is that some text editor replacement fields do not process escape characters like `\n` directly. Instead, they require a literal new line.

- When you type `\n` in a replacement box, the editor may treat it as the two literal characters `\` and `n`, not as a command for a new line.

- The workaround of copying a literal new line character and pasting it into the "Replace" field directly inserts the character the engine expects, bypassing any need for escape character interpretation in that context.