Skip to content

Perform string matching, extraction or substitution using a regex pattern

License

Notifications You must be signed in to change notification settings

vdelachaux/Regex-with-Classes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

language language code-size license

Regex-with-Classes

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

Code sample

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"

About

Perform string matching, extraction or substitution using a regex pattern

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages