Fixed search symbol.
h3rald h3rald@h3rald.com
Fri, 12 Mar 2021 19:58:19 +0100
5 files changed,
8 insertions(+),
13 deletions(-)
M
minpkg/lib/min_str.nim
→
minpkg/lib/min_str.nim
@@ -152,6 +152,9 @@ let str = vals[1]
let m = str.strVal.find(reg) var res = newSeq[MinValue](0) if m.isNone: + res.add "".newVal + for i in 0..reg.captureCount-1: + res.add "".newVal i.push res.newVal return let matches = m.get.captures
M
next-release.md
→
next-release.md
@@ -1,12 +1,3 @@
-### Breaking Changes +### Fixes -* No longer distributing lite and mini variants. -* Removed **regex** and **=~** symbols, use **search**, **replace**, **search-all**, **replace-apply** instead. -* Regular expressions are PCRE compliant. -* Renamed **match** into **match?**. -* The **split** operator now takes a PCRE as a separator. - -### New features - -* Now including statically-linked PCRE v8.44 library used for regular expression support. -* Upgraded OpenSSL to v1.1.1j. +* Fixed **search** symbol to always return a quotation containing the same number of elements (1 + number of captures). If no matches are found, the quotation contains empty strings.
M
site/contents/reference-str.md
→
site/contents/reference-str.md
@@ -127,6 +127,7 @@ > Returns a quotation containing the first occurrence of {{s2}} within {{s1}}. Note that:
> > * The first element of {{q}} is the matching substring. > * Other elements (if any) contain captured substrings. +> * If no matches are found, the quotation contains empty strings. > > > %tip% > > Tip
M
site/settings.json
→
site/settings.json
@@ -6,5 +6,5 @@ "rules": "rules.min",
"temp": "temp", "templates": "templates", "title": "min language", - "version": "0.34.0" + "version": "0.34.1" }