diff --git a/src/nre.nim b/src/nre.nim index 92cc7bbf47..29313e9ebf 100644 --- a/src/nre.nim +++ b/src/nre.nim @@ -249,7 +249,7 @@ proc initRegex*(pattern: string, options = "Sx"): Regex = if opts.study: # XXX investigate JIT result.pcreExtra = pcre.study(result.pcreObj, 0x0, addr errorMsg) - if result.pcreExtra == nil: + if errorMsg != nil: raise StudyError(msg: $errorMsg) result.captureNameToId = result.getNameToNumberTable()