Sv RegexMatch

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Returns whether the specified string_var matches the specified Regular Expression pattern.

Syntax

[help]
(match:0/1) sv_RegexMatch targetSeq:string_var regEx:formattedString formatVars(up to 20)

Example

let sTargetSeq := "Whatchamacallit"
let bMatch := sv_RegexMatch sTargetSeq "(What)(.*)"

In the above example, sTargetSeq does begin with the sequence "What", therefore bMatch equals 1.

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