mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-05 20:47:53 +00:00
de-deprecate re.nim
This commit is contained in:
@@ -7,8 +7,11 @@
|
||||
# distribution, for details about the copyright.
|
||||
#
|
||||
|
||||
## Regular expression support for Nim. Deprecated. Consider using the ``nre``
|
||||
## or ``pegs`` modules instead.
|
||||
## Regular expression support for Nim. This module still has some
|
||||
## obscure bugs and limitations,
|
||||
## consider using the ``nre`` or ``pegs`` modules instead.
|
||||
## We had to de-deprecate this module since too much code relies on it
|
||||
## and many people prefer its API over ``nre``'s.
|
||||
##
|
||||
## **Note:** The 're' proc defaults to the **extended regular expression
|
||||
## syntax** which lets you use whitespace freely to make your regexes readable.
|
||||
@@ -28,8 +31,6 @@
|
||||
import
|
||||
pcre, strutils, rtarrays
|
||||
|
||||
{.deprecated.}
|
||||
|
||||
const
|
||||
MaxSubpatterns* = 20
|
||||
## defines the maximum number of subpatterns that can be captured.
|
||||
@@ -78,7 +79,7 @@ proc finalizeRegEx(x: Regex) =
|
||||
if not isNil(x.e):
|
||||
pcre.free_substring(cast[cstring](x.e))
|
||||
|
||||
proc re*(s: string, flags = {reExtended, reStudy}): Regex {.deprecated.} =
|
||||
proc re*(s: string, flags = {reExtended, reStudy}): Regex =
|
||||
## Constructor of regular expressions. Note that Nim's
|
||||
## extended raw string literals support this syntax ``re"[abc]"`` as
|
||||
## a short form for ``re(r"[abc]")``.
|
||||
|
||||
Reference in New Issue
Block a user