Start: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
Created page with '{{ #vardefine:name|start}}{{ #vardefine:return_type|int}}{{ FunctionPage| name={{#var:name}}| function_category=String Handling Routines| function1={{Function| name={{#var:name…'
 
imported>Bale
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=String Handling Routines|


function1={{Function|
function1={{Function|
Line 27: Line 26:
}}|
}}|


function_description=Returns the starting index of the specified capturing group, or if no {{pspan|group}} is specified, it returns the index of the last group found.|
function_description=Returns the starting index of the first character matched by the specified capturing group, or if no {{pspan|group}} is specified, it returns the index of the last group found.</p>
<p>If the match was successful, but the group did not match anything, then it returns -1.|


needscode=yes|
needscode=yes|
Line 33: Line 33:
see_also={{SeeAlso|end}}|
see_also={{SeeAlso|end}}|
}}
}}
[[Category:String Handling Routines]]

Latest revision as of 05:14, 22 May 2010

needs(code_samples);

Function Syntax

int start(matcher pattern )

  • pattern is the regular expression to use

int start(matcher pattern ,int group )

  • pattern is the regular expression to use
  • group is the number of the capturing group

Returns the starting index of the first character matched by the specified capturing group, or if no group is specified, it returns the index of the last group found.

If the match was successful, but the group did not match anything, then it returns -1.

See Also

end()