Open
Description
Describe the bug
Using a pretty simple ".*$"
regexp results in No Regex pattern match
. That is with noFlags
flag that implies multiline: false
, so $
should match something.
To Reproduce
Run this code:
module Main where
import Prelude
import Data.Either (Either(..))
import Data.String.Regex.Flags (noFlags)
import Effect (Effect)
import Effect.Console (logShow)
import Parsing (Parser, fail, runParser)
import Parsing.String (regex)
-- The regex from `Parsing` but with more convenient interface.
regexP :: String -> Parser String String
regexP re = case regex re noFlags of
Left compileError -> fail $ "failed to compile regex: " <> compileError
Right ret -> ret
s = """My
multiline
string
"""
main :: Effect Unit
main = do
logShow $ runParser s $ regexP ".*$"
Expected behavior
The parser ought to return string My
Actual behavior
ParseError "No Regex pattern match" (Position { column: 1, index: 0, line: 1 }
Metadata
Metadata
Assignees
Labels
No labels