[GHC] #2540: [Text.Regex] incorrect word boundary ("\\b") substitutions

GHC trac at galois.com
Sun Aug 24 19:32:51 EDT 2008


#2540: [Text.Regex] incorrect word boundary ("\\b") substitutions
-------------------------------+--------------------------------------------
 Reporter:  Eelis-             |          Owner:  TextRegexLazy at personal.mightyreason.com
     Type:  bug                |         Status:  new                                    
 Priority:  normal             |      Milestone:  Not GHC                                
Component:  libraries (other)  |        Version:  6.8.3                                  
 Severity:  normal             |     Resolution:                                         
 Keywords:  regex              |     Difficulty:  Unknown                                
 Testcase:                     |   Architecture:  x86_64 (amd64)                         
       Os:  Unknown            |  
-------------------------------+--------------------------------------------
Changes (by igloo):

  * owner:  => TextRegexLazy at personal.mightyreason.com
  * difficulty:  => Unknown
  * milestone:  => Not GHC

Comment:

 I'd expect it to do the same things as sed:
 {{{
 $ echo "abcdef" | sed -r 's/\b(.)/|\1/g'
 |abcdef
 }}}
 i.e. it looks like a bug to me.

 Looks like the problem is how `subRegex` recurses on what comes after the
 match
 (`trail`):
 {{{
         case matchRegexAll regexp inp of
             Nothing -> inp
             Just (lead, match, trail, groups) ->
               lead ++ lookup match repl groups ++ (subRegex regexp trail
 repl)
 }}}

 Christopher, I've assigned it to you as the regex libraries maintainer.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2540#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list