Add shorthand initialization
This commit is contained in:
parent
aac71d0fc9
commit
cfb0385a02
1 changed files with 2 additions and 0 deletions
|
|
@ -282,6 +282,8 @@ proc initRegex*(pattern: string, options = "Sx"): Regex =
|
|||
raise StudyError(msg: $errorMsg)
|
||||
|
||||
result.captureNameToId = result.getNameToNumberTable()
|
||||
|
||||
proc re*(pattern: string, options = "Sx"): Regex = initRegex(pattern, options)
|
||||
# }}}
|
||||
|
||||
proc matchImpl(str: string, pattern: Regex, start, endpos: int, flags: int): RegexMatch =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue