String Handling Routines: Difference between revisions
imported>Bale cat |
imported>Heeheehee m Last I checked, group_string() used regexp. |
||
Line 18: | Line 18: | ||
{{Flink|string|url_decode|string|desc=Converts a URL formatted string into regular text.}} | {{Flink|string|url_decode|string|desc=Converts a URL formatted string into regular text.}} | ||
{{Flink|string [int]|split_string|string|{{opt|string}}|desc=Splits apart the first string at line-breaks or using an optionally supplied delimeter and returns an integer-keyed map of the result.}} | {{Flink|string [int]|split_string|string|{{opt|string}}|desc=Splits apart the first string at line-breaks or using an optionally supplied delimeter and returns an integer-keyed map of the result.}} | ||
{{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]}} | ||
{{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.}} | ||
Line 32: | Line 31: | ||
{{Flink|matcher|reset|matcher|{{opt|string}}|desc=Resets matcher to search from beginning of string, possibly with new input.}} | {{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|int|group_count|matcher|desc=Returns the number of capturing groups in the pattern.}} | ||
{{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|int|start|matcher|{{opt|int}}|desc=Returns the starting index of the previous or specified capturing group.}} | {{Flink|int|start|matcher|{{opt|int}}|desc=Returns the starting index of the previous or specified capturing group.}} | ||
{{Flink|int|end|matcher|{{opt|int}}|desc=Returns the ending index of the previous or specified capturing group plus 1.}} | {{Flink|int|end|matcher|{{opt|int}}|desc=Returns the ending index of the previous or specified capturing group plus 1.}} |
Revision as of 04:36, 4 July 2010
Simple
string to_lower_case( string )
string to_upper_case( string )
string today_to_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 )
buffer replace( buffer, int, int, string )
string url_encode( string )
string url_decode( string )
string [int] split_string( string, [string] )
string [int] session_logs( [string], int )
buffer append( buffer, string )
void set_length( buffer, int )
buffer delete( buffer, int, int )
buffer insert( buffer, int, string )
Regular Expressions
It is advised that anyone desiring to use these functions should first understand the basics of Regular Expressions and how these functions implement that language.
matcher create_matcher( string, string )
matcher reset( matcher, [string] )
string [int,int] group_string( string, string )
boolean find( matcher )
string group( matcher, [int] )
string replace_all( matcher, string )
string replace_first( matcher, string )
buffer append_replacement( matcher, buffer, string )
buffer append_tail( matcher, buffer )