Talk:String Handling Routines

From Kolmafia
Revision as of 10:39, 22 October 2007 by 218.196.195.209 (talk)
Jump to navigation Jump to search

Piccante Manga hentay gratis Refrigiwear uomo Shopping scarpa sportive geox Gianna nannini Albergo 4 stelle londra Padrona mistress Lara fabian Incontri ragazze anima gemella Salento vacanza Tessera mediaset premium scaduta La carriola pirandello Racchetta tennis Troie over 40 Viaggi venezia Tattoo farfalle Pene irritato Technogym Versioni latino Agenzia viaggi brasile Trame beautiful Video incest Genova and polizia and postale Centrifuga Elefante Costruire igrometro Hotel fontemaggio assisi Www ragazze it Angelo custode Cicciona Oroscopo cinese url Fighe diciottenni Vedi pono tutto gratis Traduttore turco gratis Sotto la gonna index Gioco online avventura Las palmas Pornovideo url Zozza Atac roma Bomboniera solidali thumba.info Lesson fisting Numero telefonico corsica ferries Www ragazze it Prenotazioni online Visto volo russia Sara varone sexy page Pal zileri Roberta missoni pompino Soluzione informatica idraulico Amatoriali nude Tavole hentai Racconti mil Lesbian kiss Www donne com Teen handjob Borsa immobiliare milano Selen porno Uomini bellissimi nudi Hotel charme brasile com br Gerani Struzzo australiano Culo trans Sito ufficiale roberta missoni Acaro Tv satellitare free Adriana volpe nuda Calcolare gli interessi bancari Volo airone Jane darling Geco polinesiano Melissadoll link Albergo istanbul Mogli hard Giusy Frasi di addio Numeri di troie Consulti cartomanzia amore tarocchi Biglietto aereo new york Livorno calcio Borsa valori page Nere porno Isole canarie Film drammatici dvd Trombare la gnocca homepage Preventivo assicurazione online Foto vip gratis rubate Fotomontaggi porno Hilary duff nuda Linfonodi collo Bmw italia link q lloro sin banderas canzoni finizio televisori mario pelchat nestle scarpe donna chanel www mundo tim com modellismo moto Alessia marcuzzi it obiettivo ponte elena sito stick rpg Alfabeto celtico midi sei tu bmw z4 2 5 costa rica cose fare corso cdl Idea regalo anniversario nike pegasus running prestito orio al serio venga a fare il soldato da noi materassi per carrozzine groupe hanini la republica aristocratica testo never wanna make you cry palla cani Giochi delle principesse sirene bounce out el mundo sony cmtcpz1 nissan scyline andiamo a lavorar Galassia piacenza ecos rocio volareweb co jeep wrangler yj haier cantina canon ef Foto lidie nuda Foto puttanelle otoo e mezzo webcam per notebook ccd konar f4 polar video sample clip Facce sborrate marie wilson eomen sesso sotto la pelle amatoriale it Consigli incontinenza urinaria pamelaanderson zip come on eileen dexys midnight runners fonetista rvd tino monovolume european concert 1998 velodyne dd12 centri spa www ministero giustizia router adsl switch lan zorbas dance e correremo insieme ninja in azione il peccato di lola ddr2 1 gb Filmati di chiavate lu cardillo mobile amd processori giochi download gratis Foto casalinghe amatoriali Emoticon sesso hd 2 5 box software per bambini lacie 80 gb mobile disk historia de un amor di guadalupe pineda lungo la strade mazda rx8 Cani jack russel dvd hd945 zeri mondo Ayda pixel32 polsini rospo Foto gabriella pession pc sacred sg zip now we are free hans zimmer bandiera australia Foto puttane gratis graduatoria igienista dentale milano Figa umida stampante all in one www italiachiamami net recenzione stigmate pantelleria isola los beatles trailer titanic poesia sulla primavera gimnaste 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.