Page History
Extracts the first pattern match from a stringInterprets an SRP Color and returns it in '#rrggbb' format.
| Code Block |
|---|
ResultHex = SRP_RegexColor("ExtractSRPStringToHex", String, Pattern) |
Returns
The substring that matched the pattern, if found, or "" if notinterpreted color in '#rrggbb' format.
Parameters
| Parameter | Description | ||
|---|---|---|---|
| String | The regex patternThe target string to be pattern matched. (REQUIRED) | Pattern | SRP Color String to interpret. (REQUIRED) |
Remarks
The Extract SRPStringToHex service is a simplified version of the Search service. Instead of returning a structure of information, this service simply returns the actual substring that was matched. This is useful when you are using regex to parse out informationconvenient combination of SRPStringToOI and OIToHex. Helpful if you need to produce HTML compliant colors from our Color technology that is widely used in the SRP ActiveX Controls.
Examples
| Code Block | ||
|---|---|---|
| ||
String ColorString = 'Call 555-1212 for info' Pattern = '((\d{3})(?:\.|-))?(\d{3})(?:\.|-)(\d{4})' PhoneNum"3DFace L+=10" Hex = SRP_RegexColor("ExtractSRPStringToHex", String, PatternColorString) |