setEnablePrefix
setEnablePrefix(enable: Boolean): JadeRegexPattern;
This fluent‑style method returns its own modified receiver, to allow call chaining. (By default, prefixes are not enabled.)
Call the setEnablePrefix method of the JadeRegexPattern class with the enable parameter set to true to set the option that causes the prefix property of produced JadeRegexMatch objects to be populated.
The following is an example of the setEnablePrefix method.
setEnablePrefixExample(); constants Text = "The quick brown fox jumped over the lazy dog"; vars pattern : JadeRegexPattern; match : JadeRegexMatch; begin create pattern; pattern.setLiteral(true) .setEnablePrefix(true) .compile("fox"); pattern.findFirst(Text, match); write match.prefix; // "The quick brown " pattern.setEnablePrefix(false).findFirst(Text, match); write match.prefix; // null epilog delete pattern; delete match; end;
You can set the prefix of a Regex pattern before or after you call the compile method.
2020.0.01 and higher