Talk:String Handling Routines

From Kolmafia
Revision as of 01:07, 25 September 2007 by 203.69.39.251 (talk)
Jump to navigation Jump to search

a d a crycry giochi puzzle da ricomporre tre amici un matrimonio e un funerale coppia marmotta accettazione tacita dell eredita zero inventi cappe a vista dth 8050 rossella brescia nuda libri sui sogni lo mejo de porno stocks pc disney reynosa immagini autopsie jvc gr dvx10 offerta lavoro stagionale big hunter simona lippolis sesso con francesca lg 1920b lil romeos screen saver buratti telefonini benq lacroix paul muoviti black tits log att v7 dmxl2 canon batterie samsung sb you re gorgeous nell aria sesso mantova arriva in europa la sala giochi di xbox live vecchio frack frigoriferi 2 motori dsdp ho bisogno del codreanu mihai o al sole batman 3 navigatore garmin le quattro stagioni vivaldi full metal jaket annunci accompagniatrici ergoline lettini pali petit sirinet com run to me vaio xp harware il signore ci ha amato ragazzo riva garda mesa aplauda la ragazza del palio www galleria d arte moderna sonny dungeons learn sometime stacy mom fountains scanner di rete cavi stereo elipsoides mercedes classe e km 0 www mision sos tv vinicio capossela video musicale digital foto storage unit punto margherita voglia di cazzo dormi magazzino fatturazione nom le so spiegare kyocera fs1000 vits smackdown vs raw platinum foto divertente il dio della peste unica me pones mal cveta majtanovic samsung ce282dns www advantagecredit com google en ingles dottor jekyll e mr hyde film dvd mariner foto gay mazda trilogy gook calendario d urso io cammino da sola gamo gofa dolby digital wireless passeggino peg perego trio babasonico numa noma iei driver motorola v810 diete atleta kavir forno a microonde ventilato Parma shopping Bullismo difendersi Classifica banche italiane Lastminute zagabria Animal xxx Inculare Sex preteen model Sacra musica spartito mp3 gregoriani canto Ilary blasi nuda Karaoke colpo fulmine Listino automobile Olio essenziale rosa Accompagnatrice escort Cellulare sony ericsson v800 Lotto estrazione Link zayn47tr daj www portaportese it Borsa serbatoio Ti sborro in bocca Cellulare philips Ariano irpino Incontro sesso libero Progettazione giardini Finanziamento abruzzo Indirizzo email san giorgio lavatrici Cavatappi parete Telecapri sport Fighe rotte gratis Airone Cartolina augurio Corriere sera vivi milano Buy adipex Ink jet Video donne che si masturbano Gonna donna Er finestra vb Albergo economico mosca Alloggi ischia Sara jay and sonia Classifica musica house Impianto gas auto lecce Albergo 5 stelle lione Assault sleep Claudia gerini Racchetta Www camxcam com Cellulare vodafone Senigallia Tacito Negozio musica Buy xenical Vedi pono tutto gratis Concessionari auto Quit smoking Imbarcazioni a motore Hotel ulivo Serena garitta nuda Wwwciaoamigos%2cit Ditalini porno Nebbiolo alba Brutal blow job Annuncio singole roma Susanna torretta sito Diva futura tv Borbonese it Aurora snow free Misha barton porno Operatore socio sanitario Cristiano ronaldo foto Francoforte hotel Nude teen Donnemature it Malaga shopping Comune di ostuni Cucine rustiche Mare puglia Arredamento rustico misura Tariffa notaio Chat gratuita Vecchie puttane Calcolo stipendio Fucili benelli Mature che scopano Prestito forus Cicciolina e i cavalli Ufficio affitto milano Ilari blasi Misuratore velocita adsl Inculami Corsi di grafica pubblicitaria Vocabolario latino Ricarica epson r800 Mortgage quota Enac Sailing rod stewart Hotel grosseto Vittoria assicurazione it Aurum hotel Adsl tv canale elenco gratis porno Ortopedico materasso 80x190 Karpathos 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.