[Haskell-cafe] Is there already a lib to parse a line of string with a pattern and generate key-value map or a record?

Magicloud Magiclouds magicloud.magiclouds at gmail.com
Wed Apr 17 09:29:20 UTC 2019


Hi,

I saw this function in some web tools, pretty useful when parsing log
or so. So I wonder if Haskell has similar libs already.

Sample:

Input line: "2019/04/17 17:27 User magicloud runs command ls."

Pattern: "${year}/${month}/${day} ${hour}:${minute} User ${username}
runs command ${command}."

Output: toList [ ("year", "2019"), ("month", "04") , etc ]

--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.


More information about the Haskell-Cafe mailing list