parent
05e9473f80
commit
27241fda23
1 changed files with 2 additions and 1 deletions
|
|
@ -649,7 +649,8 @@ else:
|
||||||
if optIgnoreStyle in options:
|
if optIgnoreStyle in options:
|
||||||
pattern = styleInsensitive(pattern)
|
pattern = styleInsensitive(pattern)
|
||||||
if optWord in options:
|
if optWord in options:
|
||||||
pattern = r"\b(:?" & pattern & r")\b"
|
# see https://github.com/nim-lang/Nim/issues/13528#issuecomment-592786443
|
||||||
|
pattern = r"(^|\W)(:?" & pattern & r")($|\W)"
|
||||||
if {optIgnoreCase, optIgnoreStyle} * options != {}:
|
if {optIgnoreCase, optIgnoreStyle} * options != {}:
|
||||||
reflags.incl reIgnoreCase
|
reflags.incl reIgnoreCase
|
||||||
let rep = if optRex in options: rex(pattern, reflags)
|
let rep = if optRex in options: rex(pattern, reflags)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue