Talk:String Handling Routines

From Kolmafia
Revision as of 05:42, 7 November 2007 by 74.92.40.194 (talk)
Jump to navigation Jump to search

jacket step away from the permutation groups freemovies com memory lapse weed sony atrac auto cheat code grand psp theft auto show effective six trait writing free nokia ringtone composer adobe photo editor free download stephen miller japan pre-menopause compare travel insurance quotes mac 11 gun pictures masturbating for orgasm incloude.info education verification diet sheet for diverticulitis wet hot sex flower fairies export sql data to excel lol lol lol lol internet business life insurance air travel last minute deal surplus online auction ny return status tax price guide for rare coins spring break girls super lotto address for virginia department of taxation lesbian porn the best motorcycle helmet verizon residential phone service xxx gout sibel kekilli motorola energy system group robert lewis stevenson state park storyboards for commercial link asian milf remington sma engines why the twin towers did not fall inventor tutorial kidney protein tests arran hotels spain gdp 2005 e-donky adipex online pet supplies and products mazda part accessory friedmans jewelry movie tickets florida lottery result mexican sex pantyhose eur j clin microbiol infect dis cymbalta and weight gain wooden shoes rack memory test computer software laser angeline nude pacific states cast iron site portal best practices upper deck kids enzyte master canada pam anderson fuck anti cancer diets acura mdx 2003 fentanyl patch insurance sale lead aclu college enalapril and supply chain management and 5 1 2 shoes satellite photos myspace font free quilt patterns piem s african pop music vitamin c daily requirements adopt a child school gerls retirement savings program free lesbian porn movie lunesta side effects templating busty amateur zodiac signs 3d background play the mansion indian mexican tribe wedding flower holders new construction charlotte nc presentacion de una empresa peter regan escape code for world poker tour commerce sean johns clothing line pictures of slavery in africa tco 99 resell computer audiovox ringtone up do hairstyle photos shabby chic baby sheets order actos vintage nudists photo galleries teenage girls with red hair 2 block writer info http search ebay com electr information on addiction icao code register domain names search engine volkswagen truck adventure tourism canada pictures of geisha girl hydrocodone pacific specialty ins the wellington hotel ny oregon cell phone service list zombie movie discount wellbutrin time in lahore italian visa uk cheap paxil maintenance web site india problem solving games for children cheap ionamin army of the night mac network games liqueur chocolate cheap codeine protection racket cases microsoft problem window twisted porn picture download tv ringtones discount imitrex buy zanaflex our lady peace life lyric power plant professional void volume fraction jobs in lansing mi local radar texas weather buspar online esp audio pages port stephens australia art image space ip table robert frances group buy ephedra internet explorer wont connect to internet what is a non compete clause x box rainbow six 3 cheat code kyocera ringtone article discipline in school pension health phoenix az. real estate precision flight controls inc playing music on psp myspace symbol text marriot singapore hotel leathers clothing to beat the child was bad enough tracker cars angelina jolie naked pic international freight forwarding uk software for cnc national labour market statistics also as known madonna rock metformin online buy tamiflu carisoprodol landscape phoenix services removing moles australia discount tours personalized kid toy order fluoxetine mortgage lending companies xhtml form elements speaking trumpet apartment city downtown iowa screenshots vista window assurance empire general life underwriter salary ip address location software patriots helmets diflucan online small in ground pool airport logan map mortar tile mens medium hair styles evolution midi controllers theme of as i lay dying epilepsy brain disorder So wtf does group_string actually do? The linked "descriptive" post has an utterly unhelpful example. Has anyone ever used it for anything?

Groups a string into a map using a regular expression. To understand the function you must know. 1. What maps are and how they are used. 2. Understand what regular expressions are and how to create them.

Using the original post:

FUNCTION DEFINTION: string [int,int] group_string( string source, string regex ) EXAMPLE: string [int,int] test = group_string( "This is a test", "([a-z] ) " );

Example Breakdown: string [int,int] Define a map. Two dimensional. The indices are integers. The data is stored as a string. test Define the map with name test. group_string Call the function. "This is a Test" Feeding the function a sample string. "([a-z] ) " Your regular expression.

Regular expressions deal with pattern matching. You want the function to find a particular pattern. The function then returns that pattern, or the stuff before it, or the stuff after it, or splits them appart, or squeezes them together. So what does this regular expression look for? The Parenthesis (): Tell the function this is a group of characters. [a-z]: Tell us they will be lower case letters.  : Tell us to look for one or more characters. That space between the ) and " Tells us the pattern ends in a space.

Thus reading down the string. T = Does not match [a-z] is a capital letter. h = Matches [a-z]. Starting Group i = Matches [a-z] s = Matches [a-z]

 = Matches space. First group found and is "his "

i = Matches [a-z]. Starting Group s = Matches [a-z]

 = Matches space. Second group found, and is "is "

a = Matches [a-z]. Starting Group

 = Matches space. Third group found, and is "a "

t = Matches [a-z]. Starting Group e = Matches [a-z] s = Matches [a-z] t = Matches [a-z] End of line. No more matches. Stop.

Thus, trusting the post, the map would be:

test[0][0] => "his " test[0][1] => "his" test[1][0] => "is " test[1][1] => "is" test[2][0] => "a " test[2][1] => "a"

I personally haven't used it. Would be used in parsing a page by hand.