reMatch
Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.
reMatch(reg_expression, string) → returns array
Argument Reference
reg_expression string Required
Regular expression for which to search. Case-sensitive.
string string Required
A string or a variable that contains one. String in which to search.
Links more information about reMatch
- Learning ReMatch by Ben Nadel - Tutorial style article on using the reMatch function in CFML.
Examples Sample code invoking the reMatch function
Extracts numbers from a string and returns them as an array
serializeJSON( reMatch("[0-9]+", "1 way to extract any number like 45, 38") ) Expected Result: ["1","45","38"]
© 2012–present Foundeo, Inc. and the CFDocs contributors.
Licensed under the MIT License.
ColdFusion is a trademark of Adobe Systems Incorporated.
https://cfdocs.org/rematch