String Handling Routines: Difference between revisions
imported>Bale fixes |
imported>Bale my brain stopped being able to parse that. I regained my senses. |
||
Line 25: | Line 25: | ||
==Regular Expressions== | ==Regular Expressions== | ||
{{Flink|matcher|create_matcher|string|string|desc=Creates a matcher from a pattern and input string.}} | {{Flink|matcher|create_matcher|string|string|desc=Creates a matcher from a pattern and input string.}} | ||
{{Flink|matcher|reset|matcher | {{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|int|start|matcher | {{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 | |||
{{ | |||
{{Flink|boolean|find|matcher|desc=Finds the next instance of the pattern or returns false if no more matches exist.}} | {{Flink|boolean|find|matcher|desc=Finds the next instance of the pattern or returns false if no more matches exist.}} | ||
{{Flink|string|group|matcher | {{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|string|replace_all|matcher|string|desc=Replaces all pattern matches with a given string.}} | {{Flink|string|replace_all|matcher|string|desc=Replaces all pattern matches with a given string.}} | ||
{{Flink|string|replace_first|matcher|string|desc=Replaces the first pattern match with a given string.}} | {{Flink|string|replace_first|matcher|string|desc=Replaces the first pattern match with a given string.}} |
Revision as of 07:06, 5 May 2010
Simple
string to_lower_case( string )
string to_upper_case( string )
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 )
buffer append( buffer, string )
buffer delete( buffer, int, string )
buffer insert( buffer, int, int )
Regular Expressions
matcher create_matcher( string, string )
matcher reset( matcher, [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 )
Attention KoLmafia Experts!
We need your help; some details of this function's operation are unknown or unclear.
The following specific questions have been raised:
- Argh, anyone comfortable with regex who wants to fill in the blanks?
- Please? (Feel free to ignore formatting and just describe what happens)