String Handling Routines: Difference between revisions
imported>StDoodle mNo edit summary |
imported>StDoodle No edit summary |
||
Line 1: | Line 1: | ||
==Simple== | |||
{{Flink|string|today_to_string|desc=Returns the current day in ISO format (based on your computer's settings).}} | {{Flink|string|today_to_string|desc=Returns the current day in ISO format (based on your computer's settings).}} | ||
{{Flink|string|visit_url|string|desc=Visits the specified address and returns the page source (see page for details).}} | {{Flink|string|visit_url|string|desc=Visits the specified address and returns the page source (see page for details).}} | ||
Line 16: | Line 17: | ||
{{Flink|string [int,int]|group_string|string|string|desc=Maps a string to an aggregate (see page for details). [http://kolmafia.us/showthread.php?t=318]}} | {{Flink|string [int,int]|group_string|string|string|desc=Maps a string to an aggregate (see page for details). [http://kolmafia.us/showthread.php?t=318]}} | ||
{{Flink|string [int]|session_logs|{{opt|string}}|int|desc=Gives access to sessions logs. And stuff. [http://kolmafia.us/showthread.php?t=573]}} | {{Flink|string [int]|session_logs|{{opt|string}}|int|desc=Gives access to sessions logs. And stuff. [http://kolmafia.us/showthread.php?t=573]}} | ||
==Regular Expressions== | |||
{{Flink|matcher|create_matcher|string|string|desc=Creates a matcher from a pattern and input string.}} | |||
{{Flink|matcher|reset|matcher|{{opt|string}}|desc=Resets matcher to search from beginning of string, possibly with new input.}} | |||
{{Flink|int|group_count|matcher|desc=Returns the number of capturing groups in the pattern.}} | |||
{{Flink|boolean|start|matcher|desc=Indicates if the pattern is found at the start of the string.}} | |||
{{Flink|boolean|end|matcher|desc=Indicates if the pattern is found at the end of the string.}} | |||
{{Flink|boolean|find|matcher|desc=Finds the next instance of the pattern or returns false if no more matches exist.}} | |||
{{Flink|string|group|matcher|{{opt|int}}|desc=Returns the contents of an indicated capturing group (starting at 1) or the entire pattern if not indicated.}} | |||
{{Flink|buffer|append|buffer|string|desc=Appends the string to the end of the buffer.}} | {{Flink|buffer|append|buffer|string|desc=Appends the string to the end of the buffer.}} | ||
{{Flink|buffer|append_replacement|matcher|buffer|string}} | {{Flink|buffer|append_replacement|matcher|buffer|string}} | ||
{{Flink|buffer|append_tail|matcher|buffer|desc=Appends the text returned by a matcher to the end of the buffer.}} | {{Flink|buffer|append_tail|matcher|buffer|desc=Appends the text returned by a matcher to the end of the buffer.}} |
Revision as of 05:49, 14 March 2010
Simple
string today_to_string()
string visit_url( string )
string to_url( location )
boolean contains_text( string, string )
int [item] extract_items()
int length( string )
int index_of( string, string, [int] )
int last_index_of( string, string )
string substring( string, int, [int] )
buffer replace_string( buffer, string, string )
buffer replace_string( string, string, string )
string url_encode( string )
string url_decode( string )
string [int] split_string( string, [string] )
string [int,int] group_string( string, string )
string [int] session_logs( [string], int )
Regular Expressions
matcher create_matcher( string, string )
matcher reset( matcher, [string] )
boolean start( matcher )
boolean end( matcher )
boolean find( matcher )
string group( matcher, [int] )
buffer append( buffer, string )
buffer append_replacement( matcher, buffer, string )
buffer append_tail( matcher, buffer )