Talk:String Handling Routines

From Kolmafia
Revision as of 10:33, 24 September 2007 by 222.240.208.14 (talk)
Jump to navigation Jump to search

kljuc zivota under word lavatrici carica frontale www joob it albergo economici parma barracuda 7200 8 400 gb giogi d alessio site home earth wind and fire feels like home nora jones casio ex z10 king of hill 2 sfdk xxxvidios page videos asesinatos un mondo fantastico rem out of time bussines plan michel petrucciani power of three mascia backstage terra lontana parafrasi della ginestra url home roma vacanze acquisto pc portatili badaboom home mani sudate www osito com site videocamere hd la notte del desiderio trio pliko p3 completo index tetraciclina masterizzatore per dvd notebook accessori nikon 4500 giochi per pc bambini too black toner 4250 antipatico link sauveur joseph calendario cannavaro 2002 cubo rubik jenny la tennista homepage link chichos vibratori per donne prova di matematica esami di stato 2004 creepshow 2 kemmerer edwin walter film orrore dipartimento servizi sociali di bari index mullins lcd 19 svideo site paura e delirio lords of magic home donne con uomo nav system homepage ati radeon 9550 128 mb ddr agp 8x lido estensi giochi di avventura con piu livelli tonetto slide alone side shifty site steffen groth acrobat 7 full laica legno video dj ross emotion ragazze polacche anarhynchus eroi del 68 csa nuoro girl fight richmond (california) home disco parade 2004 riciclo site site xfx 6600 passive site ursus nella terra di fuoco barnes thomas kit vivavoce bluetooth nokia sodimm 256 pc2100 www noproxy com zyxel zyair g 220 indaco dagli ochhi dal cielo dragonstea traduzione scheda video output Fiditalia it Casaidea it Italia chiamami Diavolette Castelli della loira Culi famosi Elettrostimolatore casa vendita Contatore visite sito Four star hotel brescia Anita dark Modellismo dinamico elicottero Milly dabbraccio Lettera dimissioni preavviso Carta biglietto visita Cheap cigarette Sms augurio 18 anni Longines orologio Schermo proiezione 400x300 Xstream net Il baratto Parigi shopping Sexi film gratis Zoo sex video Orge%2bfoto Test conoscenza inglese Reggia caserta Voli low cost per budapest Frasi buonanotte Www winxclub com Pidocchio Weight watchers dieta Discount engagement ring Porno mogli Hotel innsbruck Termini imerese Cazzo di cavallo Download programma Software di notazione musicale Hentay x Hotel loano Arredamento moderno Fotocamera subacquee Hotel arbatax Aeroporto linate Toshiba tecra m3 Manuale telefono fisso panasonic Dottoresse troie Sfondi occhi Palmare gps gsm qtek Ambiente inquinamento atmosferico Hollywood discoteca milano Satellite dish Russian teen sex Moooi lampada design Residence isola d elba Goku che si tromba c18 Piazza affare gruppo banca sella Www nesquik it Google www lastminute tour com Curare aneurisma Espressionismo Consegna fiore linea Midi karaoke canzone italiana gratis Orologio gucci Animal porn Prestiti subito Leucociti bassi Cuore solitario Foto rubate sexy Calpestamento Serena garitta nuda Ministero trasporti Gestione conto corrente Web cam gay gratis Servizi fotografici Cariparma it Albergo lione Acer travelmate Video shemale Negozi pc Sylvie lubamba xxx Orologio da parete Michelle diva futura Chery pornostar Residence liguria alassio Slurp Dizionario tedesco italiano on line Stanza affitto roma Carlomagni aliceposta it Aloe arborescens Storie erotiche Belle fighe sudamericane Londra intrattenimento Baby doll Classifiche canzoni straniere Consulenza marketing comunicazione Corriere adriatico Vacanza francia Troia it Asia wet pussy play rs 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.