We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c332978 commit fdf46a1Copy full SHA for fdf46a1
regex.v
@@ -59,11 +59,10 @@ pub fn new_regex(source string, options int) !Regex {
59
}
60
extra := C.pcre_study(re, 0, voidptr(&pstudyerr))
61
if extra == 0 {
62
- if pstudyerr == 0 {
63
- return error('no additional information')
+ if pstudyerr != 0 {
+ err := unsafe { cstring_to_vstring(pstudyerr) }
64
+ return error('Failed to study regex: ${err}')
65
- err := unsafe { cstring_to_vstring(pstudyerr) }
66
- return error('Failed to study regex: ${err}')
67
68
C.pcre_fullinfo(re, 0, C.PCRE_INFO_CAPTURECOUNT, &captures)
69
return Regex{re, extra, captures, options}
0 commit comments