Sv RegexSearch
From GECK
A function added by the JIP NVSE Plugin.
Contents
Description
Returns an array_var containing all matches in the specified string_var to the specified Regular Expression pattern.
Syntax
(matches:array_var) sv_RegexSearch targetSeq:string_var regEx:formattedString formatVars(up to 20)
Example
let sTargetSeq := "This subject has a submarine as a subsequence" let aMatches := sv_RegexSearch sTargetSeq "\b(sub)([^ ]*)"
In the above example, aMatches will contain every whole word in sTargetSeq that begins with the sequence "sub" ("subject", "submarine" and "subsequence").
Notes
- regEx supports string formatting, and up to 20 variables may be used.
- Will crash the game if the Regex pattern is invalidly formatted. If it cannot be verified before the script runs, use ValidateRegex.
See Also
- sv_Find
- sv_RegexMatch
- sv_RegexReplace
- To test Regex expressions, consider using this website: Regex101