Skip to content

Commit 8baad6d

Browse files
committed
Document that for "usual" regex behavior multiline is required
Regular expression users typically expect that matching a `$` in a multiline string would match the end of current line and not the end of the string past many lines. This is default behavior in pretty much every regexp engine: `grep`, `perl`, text editors, you name it… So it is fair to expect such expectation, so warn a user about necessity to pass `multiline` Fixes: #231
1 parent c38e6ea commit 8baad6d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/Parsing/String.purs

+3
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ match p = do
195195

196196
-- | Compile a regular expression `String` into a regular expression parser.
197197
-- |
198+
-- | Note that per JS RegExp semantics matching a single line in a multiline
199+
-- | string requires passing `multiline` flag rather than `noFlags`.
200+
-- |
198201
-- | This function will use the `Data.String.Regex.regex` function to compile
199202
-- | and return a parser which can be used
200203
-- | in a `ParserT String m` monad.

0 commit comments

Comments
 (0)