Page History
Returns the last error that occurred when using SRP_RegexFormats an OI color to '#rrggbb' format.
| Code Block |
|---|
ErrorHex = SRP_RegexColor("ErrorOIToHex", Color) |
Returns
An error message if there was an error on the last SRP_Regex call, "" if notOI color formatted in '#rrggbb' format.
Remarks
The Error OIToHex service returns an error message describing the error that occurred the last time an SRP_Regex service was called. This means that when the Match service, for example, returns 0, it might be due to an error in the pattern that was given to it rather than it failing the pass. The example below shows how to test for that errorformats an OI color–which is internally formatted as an integer representing RGB color–making it suitable for use in HTML environments. This format is also a more human readable format suitable for storage.
Examples
| Code Block | ||
|---|---|---|
| ||
PatternColor = '*@mydomain\.com$' Result = SRP_Regex('Match', 'john.doe@mydomain.com', Pattern) If Results EQ 0 then ErrorRGB(255, 127, 0) Hex = SRP_Regex('Error') If Error NE "" then // there was an error doing the match: "regex_error(error_badrepeat): One of *?+{ was not preceded by a valid regular expression." end endColor("OI2Hex", Color) |