Softanza
StartFrançais
Softanza
The library documents itself · Pattern matching

stzConditionalRegexMaker

14 own methods · 0 forms written with extensions, listed under their method

the source: base/regex/stzRegexMaker.ring(opens in a new tab) · All classes · The area reference: Pattern matching

Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean

Examples: 2 come from the library's tests; 8 were composed from each method's signature and run for this page, on a fresh object, for example o1 = new stzConditionalRegexMaker(). 4 methods have none yet. Examples run on 2026-10-04 07:31 inside the library at commit 0e72e2e2c.

Method
Explanation, as the source carries it
init
(no comment in the source: the name reads as a sentence) initno extension
Reset
(no comment in the source: the name reads as a sentence) resetno extension
if part 1 examples run
o1 = new stzConditionalRegexMaker
o1.IfMatch("^\d{4}").          		# Starts with 4 digits
   ThenMatch("\d{4}-\d{2}-\d{2}").  	# YYYY-MM-DD
   ElseMatch("\d{2}/\d{2}/\d{4}")   	# DD/MM/YYYY
? o1.Pattern()
#--> (?(?=^\d{4})\d{4}-\d{2}-\d{2}|\d{2}/\d{2}/\d{4})
library testno extension
IfNotMatch
if part
composed example
o1 = new stzConditionalRegexMaker()
o1.IfNotMatch("[0-9]+")
? o1.Pattern()
#--> (?(?![0-9]+))
composed from the signature, run for this page
no extension
IfCaptured
if partno extension
ThenMatch
then part
composed example
o1 = new stzConditionalRegexMaker()
o1.IfMatch("[0-9]+")
o1.ThenMatch("[a-z]+")
o1.ElseMatch("x")
? o1.Pattern()
#--> (?(?=[0-9]+)[a-z]+|x)
composed from the signature, run for this page
no extension
ElseMatch
else part
composed example
o1 = new stzConditionalRegexMaker()
o1.IfMatch("[0-9]+")
o1.ThenMatch("[a-z]+")
o1.ElseMatch("x")
? o1.Pattern()
#--> (?(?=[0-9]+)[a-z]+|x)
composed from the signature, run for this page
no extension
IfStartsWith
IfMatch()/IfNotMatch() are the pattern-taking pair, and IfPrecededBy()/ IfFollowedBy() build look-arounds, which are patterns by nature. The three text predicates here are the literal ones.
composed example
o1 = new stzConditionalRegexMaker()
o1.IfStartsWith("http")
? o1.Pattern()
#--> (?(?=^http))
composed from the signature, run for this page
no extension
IfEndsWith
Literal text -- IfEndsWith(".edu") means the four characters ".edu", not "any character followed by edu", which is what it built before.
composed example
o1 = new stzConditionalRegexMaker()
o1.IfEndsWith("http")
? o1.Pattern()
#--> (?(?=http$))
composed from the signature, run for this page
no extension
IfContains
Literal text.
composed example
o1 = new stzConditionalRegexMaker()
o1.IfContains("http")
? o1.Pattern()
#--> (?(?=.*http.*))
composed from the signature, run for this page
no extension
IfPrecededBy
common helpers
composed example
o1 = new stzConditionalRegexMaker()
o1.IfPrecededBy("[0-9]+")
? o1.Pattern()
#--> (?(?=(?<=[0-9]+)))
composed from the signature, run for this page
no extension
IfFollowedBy
common helpers
composed example
o1 = new stzConditionalRegexMaker()
o1.IfFollowedBy("[0-9]+")
? o1.Pattern()
#--> (?(?=(?=[0-9]+)))
composed from the signature, run for this page
no extension
pattern output 1 examples run
o1 = new stzConditionalRegexMaker
o1.IfMatch("^\d{4}").          		# Starts with 4 digits
   ThenMatch("\d{4}-\d{2}-\d{2}").  	# YYYY-MM-DD
   ElseMatch("\d{2}/\d{2}/\d{4}")   	# DD/MM/YYYY
? o1.Pattern()
#--> (?(?=^\d{4})\d{4}-\d{2}-\d{2}|\d{2}/\d{2}/\d{4})
library testno extension
Info
pattern outputno extension