REFind

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

REFind(reg_expression, String [, start] [, returnsubexpressions]) → returns Object

REFind Argument Reference

reg_expression
Required

String
Required

A string or a variable that contains one. String in which
to search.

start
Default: 1

Values:
  • 1

returnsubexpressions
Default: NO

True: if the regular expression is found, the first array
element contains the length and position, respectively,
of the first match.
If the regular expression contains parentheses that
group subexpressions, each subsequent array element
contains the length and position, respectively, of
the first occurrence of each group.
If the regular expression is not found, the arrays each
contain one element with the value 0.
False: the function returns the position in the string
where the match begins. Default.

Links more information about REFind

Examples sample code invoking the REFind function


Find an integer in a string

This example uses reFind to locate an integer in a string, and returns the position of the integer in the string.

REFind("[0-9]+", "test 123!")

Expected Result: 6


Fork me on GitHub