The goal of this class is to reduce the complexity of code to use Regex in 4D.
This class will be augmented according to my needs but I strongly encouraged you to enrich this project through pull request. This can only benefit the 4D developer community
See the documentation (also available via the Explorer's documentation panel) or the method test_regex to learn how to use it.
📌 This code is an evolution of the regex component.
Enjoy the 4th dimension
var $regex : cs.regex
$regex:=cs.regex.new("Hello world, the world is wonderful but the world is in danger"; "Hello (world)")
var $match : Boolean
$match:=$regex.match() // = True
var $c : Collection
$c:=$regex.extract() // = [ "Hello world", "world" ]
$c:=$regex.extract(1) // = [ "world"]
var $result : Text
$result:=$regex.substitute("Vincent") // = "Vincent, the world is wonderful but the world is in danger"