Next revision
|
Previous revision
|
en:instrx [2016/01/01 22:41] 127.0.0.1 external edit |
en:instrx [2020/02/28 10:46] (current) |
===== Instrx (Function) ===== | ===== Instrx (Function) ===== |
==== Format ==== | ==== Format ==== |
**instrx** ( //haystack_expr// , //regex_expr// )\\ | **instrx** ( [[stringexpressions|haystack_string_expression]] , [[regularexpressions|regular_expression]] )\\ |
**instrx** ( //haystack_expr// , //regex_expr// , //start_expr// ) | **instrx** ( [[stringexpressions|haystack_string_expression]] , [[regularexpressions|regular_expression]] , [[integerexpressions|start_expression]] ) |
| |
returns //positive_integer_expr// | returns [[integerexpressions|integer_expression]] |
| |
==== Description ==== | ==== Description ==== |
Check to see if the text represented by the regular expression //regex_expr// is contained in the string //haystack_expr//. If it is, then this function will return the index of starting character of the first place where //needle_expr// occurs. Otherwise, this function will return 0. You may also specify an optional starting location for the search to begin //start_expr//. Unlike INSTR, INSTRX allows ignoring specific variations (case sentive, spelling etc). | Check to see if the text represented by the regular expression [[regularexpressions|regular_expression]] is contained in the string [[stringexpressions|haystack_string_expression]]. If it is, then this function will return the index of starting character of the first place where [[stringexpressions|needle_string_expression]] occurs. Otherwise, this function will return 0. |
| |
| You may optionally specify a starting location for the search to begin [[integerexpressions|start_expression]]. If the start is 1 or greater the search will begin from the specified character from the start. If the start is < 0 then the search will begin from the nth character from the end. The search will ALWAYS look forward. |
==== Note ==== | ==== Note ==== |
String indices begin at 1. | String indices begin at 1. |
| |
==== Example ==== | ==== Example ==== |
<code> | <code> |
==== History ==== | ==== History ==== |
|0.9.6.56|New To Version| | |0.9.6.56|New To Version| |
| |1.99.99.53|Added start position < 0| |
| |