Table of Contents

Instrx

Format

instrx ( haystack , regex )
instrx ( haystack , regex , start )

Description

Check to see if the text represented by the regular expression regex is contained in the string haystack. If it is, then this function will return the index of starting character of the first place where needle occurs. Otherwise, this function will return 0. You may also specify an optional starting location for the search to begin start.Unlike INSTR, INSTRX allows ignoring specific variations (case sentive, spelling etc).

Note

String indices begin at 1.

Example

print instrx("HeLLo", "[Ll]o")
print instrx("Hello, Kitti","[Ii]",10)

will display

4
12

New To Version

0.9.6.56