Project

General

Profile

Actions

Bug #169

open

[GHC] Text.Regex.Posix does not understand \w

Added by Igor Pashev almost 10 years ago. Updated almost 10 years ago.

Status:
Feedback
Priority:
Low
Assignee:
-
Start date:
2014-05-08
Due date:
% Done:

60%

Estimated time:

Description

Linux:

# ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> import Text.Regex.Posix
Prelude Text.Regex.Posix> let line = "[ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)" 
Prelude Text.Regex.Posix> line =~ "xK_(\\w+)" :: (String, String, String, [String])
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-posix-0.95.2 ... linking ... done.
("[ ((modMask .|. shiftMask, ","xK_Return","), spawn $ XMonad.terminal conf)",["Return"])
Prelude Text.Regex.Posix> 

Dyson:

# ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> import Text.Regex.Posix
Prelude Text.Regex.Posix> let line = "[ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)" 
Prelude Text.Regex.Posix> line =~ "xK_(\\w+)" :: (String, String, String, [String])
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-posix-0.95.2 ... linking ... done.
("[ ((modMask .|. shiftMask, xK_Return), spawn $ XMonad.terminal conf)","","",[])
Prelude Text.Regex.Posix>

This causes Xmonad FTBFS.

Workaround:

Prelude Text.Regex.Posix> line =~ "xK_([[:alnum:]]+)" :: (String, String, String, [String])
("[ ((modMask .|. shiftMask, ","xK_Return","), spawn $ XMonad.terminal conf)",["Return"])

It does not depend on whether libc regex or bundled regex is used. Maybe because these sources have common ancestor :-)

Actions #1

Updated by Igor Pashev almost 10 years ago

  • Description updated (diff)
Actions #2

Updated by Igor Pashev almost 10 years ago

  • % Done changed from 0 to 60
  • Description updated (diff)
  • Status changed from New to Feedback
  • Priority changed from Normal to Low
Actions #3

Updated by Igor Pashev almost 10 years ago

  • Subject changed from [GHC] Text.Regex.Posix is broken to [GHC] Text.Regex.Posix does not understand \w
Actions

Also available in: Atom PDF