Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

The regex pattern
ParameterDescription
StringThe target string to be pattern matched. (REQUIRED)PatternSRP 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
languagebp
String ColorString  = 'Call 555-1212 for info'
Pattern  = '((\d{3})(?:\.|-))?(\d{3})(?:\.|-)(\d{4})'
PhoneNum"3DFace L+=10"
Hex = SRP_RegexColor("ExtractSRPStringToHex", String, PatternColorString)