• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Name

REFind

Synopsis

                    REFind(regex, string [, startpos] [, returnsubexpressions])

Performs a case-sensitive search. Returns the position of the first occurrence of regex in string. regex can be any valid ColdFusion regular expression. An optional starting position for the search can be specified by startpos. If returnsubexpressions is set to true (false is the default), REFind( ) returns a CFML structure containing two arrays, pos and len that represents the position and length, respectively, of the matched regular expression. If the regular expression contains parenthesized subexpressions, the first index of the array returns the len and pos of the first occurrence of the match for the entire regular expression. Each subsequent array index in the returned structure contains the len and pos for the first occurrence of each parenthesized subexpression in the matched regular expression. If REFind( ) is unable to find a match for the regular expression, 0 is returned. REFind( ) performs a case-sensitive search. The following example demonstrates the use of the REFind( ) function with the returnsubexpressions parameter set to true:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint