All Bundles
RegEx
Regular expression engine.
Support for following matches:
- . ‐ any
- ? ‐ optional
- * ‐ zero or more repetitions
- + ‐ one or more repetitions
- ^ ‐ first single match
- $ ‐ last single match
- group ‐ (one|two|three)
- range ‐ [start-end]
Support for following special patterns:
- word ‐ \w
- not word ‐ \W
- digit ‐ \d
- not digit ‐ \D
- white space ‐ \s
- not white space ‐ \s
- repeat ‐ {least, most}
Operations
New
Default constructor
New(input:String)
Parameters
Name | Type | Description |
---|
input | String | regex pattern |
Find
Finds all occurrences
method : public : native : Find(input:String) ~ Vector<Result>
Parameters
Name | Type | Description |
---|
input | String | string to match against |
Return
FindFirst
Matches the first occurrence
method : public : native : FindFirst(input:String) ~ Result
Parameters
Name | Type | Description |
---|
input | String | string to match against |
Return
Type | Description |
---|
Result | matched string if found, empty string otherwise |
IsOk
Check of the regex was parsed correctly
method : public : IsOk() ~ Bool
Return
Type | Description |
---|
Bool | true if parsed, false otherwise |
Match
Matches as much of the string as possible
method : public : Match(input:String) ~ String
Parameters
Name | Type | Description |
---|
input | String | string to match against |
Return
Type | Description |
---|
String | matched string if found, empty string otherwise |
Matches as much of the string as possible
method : public : Match(input:String, offset:Int) ~ String
Parameters
Name | Type | Description |
---|
input | String | string to match against |
offset | Int | offset into the to match against |
Return
Type | Description |
---|
String | matched string if found, empty string otherwise |
MatchExact
Looks for an exact regex match
method : public : MatchExact(input:String) ~ Bool
Parameters
Name | Type | Description |
---|
input | String | string to match against |
Return
Type | Description |
---|
Bool | true if exact, false otherwise |
ReplaceAll
Replaces all occurrences of the given string
method : public : native : ReplaceAll(input:String, replace:String) ~ String
Parameters
Name | Type | Description |
---|
input | String | string to match against |
replace | String | string to replace the match with |
Return
Type | Description |
---|
String | replaced string |
ReplaceFirst
Replaces the first occurrence with the given string
method : public : native : ReplaceFirst(input:String, replace:String) ~ String
Parameters
Name | Type | Description |
---|
input | String | string to match against |
replace | String | string to replace the match with |
Return
Type | Description |
---|
String | replaced string |