rEMatch

Description

Uses a regular expression (RE) to search a string for a pattern, starting from a specified position. The search is case sensitive.

Categories

Related

Syntax

REMatch(reg_expression, string)

Attributes

AttributeDescriptionRequiredDefault
reg_expressionRegular expression for which to search. Case sensitive. For more information, see Using Regular Expressions in Functions in the Developing ColdFusion Applications.
stringA string or a variable that contains one. String in which to search.

Returns

An array of strings that match the expression.

Usage

This function finds all occurrence of a regular expression in a string.

Example

<!--- Find all the URLs in a web page retrieved via cfhttp:. ---> 
<!--- The search is case sensitive. ---> 
result = REMatch("https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?", cfhttp.filecontent);