Talk:String Handling Routines: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Metraxis
Revert. Again.
No edit summary
Line 1: Line 1:
So wtf does group_string actually do?  The linked "descriptive" post has an utterly unhelpful example.  Has anyone ever used it for anything?
[http://afreelancespork.ifrance.com/text/km-renault/ km0 renault clio benzina auto km 0] [http://poriddle.ifrance.com/articles/britannia/ britannia 25] [http://chelsxd.ifrance.com/directory/esibizionismo-roma.htm esibizionismo roma] [http://wagreenw.ifrance.com/text/alice-in.htm alice in chains music bank the videos] [http://stormclouds13.ifrance.com/description/hoda.htm hoda] [http://lucornew.ifrance.com/articles/televisori-da/ televisori da 37] [http://pulema.ifrance.com/small/milano-bergamo.htm milano bergamo bruxelles biglietti aerei] [http://afreelancespork.ifrance.com/text/carta-de/ carta de verano] [http://drgreghousemd.ifrance.com/library/televisori-lcd/ televisori lcd sanyo] [http://scalek.ifrance.com/styles/decapitazioni-ostaggi/ decapitazioni ostaggi in irak] [http://romonjon.ifrance.com/directory/mobile-per/ mobile per lcd] [http://stormclouds13.ifrance.com/description/www-nic.htm www nic berg it] [http://paheidi.ifrance.com/blog/test-ammissione/ test ammissione psicologia libri] [http://qizzlary.ifrance.com/resources/barcellona-quenn.htm barcellona quenn] [http://mctungat.ifrance.com/text/la-ragazza/ la ragazza di dublino] [http://kialford.ifrance.com/directory/hotel-maria/ hotel maria] [http://qizzlary.ifrance.com/resources/foto-desktop.htm foto desktop gratis] [http://drgreghousemd.ifrance.com/library/casio/ casio] [http://xbr00t4lx.ifrance.com/directory/equus.htm equus] [http://nakramer.ifrance.com/small/tesine-di.htm tesine di economia] [http://kemenke.ifrance.com/directory/idioti.htm idioti] [http://anskaggs.ifrance.com/resources/testi-san.htm testi san salvador moonlight] [http://romonjon.ifrance.com/directory/miltiorrhiza/ miltiorrhiza] [http://stasenka.ifrance.com/lib/magari-renato/ magari renato zero] [http://wagreenw.ifrance.com/text/medicina-ospedali.htm medicina ospedali] [http://kemenke.ifrance.com/directory/ati-amd.htm ati amd portatili] [http://kialford.ifrance.com/directory/films-gratis/ films gratis] [http://paheidi.ifrance.com/blog/amstrad-hdd/ amstrad hdd] [http://drgreghousemd.ifrance.com/library/auguri-di/ auguri di natale in power point] [http://hapierce.ifrance.com/text/ricoh-fax/ ricoh fax] [http://xbr00t4lx.ifrance.com/directory/busty-redhead.htm busty redhead] [http://kemenke.ifrance.com/directory/io-mammeta.htm io mammeta e tu] [http://qizzlary.ifrance.com/resources/halo-.htm halo 2 pc] [http://nereinig.ifrance.com/styles/voglia-di.htm voglia di vincere] [http://stasenka.ifrance.com/lib/vecchie-coppie/ vecchie coppie porche] [http://pulema.ifrance.com/small/sale-cinema.htm sale cinema medusa] [http://wagreenw.ifrance.com/text/supporto-mp.htm supporto mp3] [http://chelsxd.ifrance.com/directory/digitale-terrestre.htm digitale terrestre offerta] [http://qizzlary.ifrance.com/resources/spedizionieri-verona.htm spedizionieri verona] [http://stormclouds13.ifrance.com/description/rociera.htm rociera] [http://poriddle.ifrance.com/articles/recinzione-giardino/ recinzione giardino] [http://sonicmaind.ifrance.com/styles/tecno-new.htm tecno new age] [http://paheidi.ifrance.com/blog/asrock-dualgl/ asrock 775dual915gl] [http://lucornew.ifrance.com/articles/vaio-sxp/ vaio s4xp] [http://poriddle.ifrance.com/articles/friends-stagione/ friends stagione 7] [http://pulema.ifrance.com/small/nic.htm nic] [http://afreelancespork.ifrance.com/text/www-esselunga/ www esselunga it privacy] [http://afreelancespork.ifrance.com/text/creatina-e/ creatina e carnitina] [http://hapierce.ifrance.com/text/tutte-le/ tutte le manie di bob] [http://xbr00t4lx.ifrance.com/directory/gioielli-antichi.htm gioielli antichi] [http://afreelancespork.ifrance.com/text/fiat-coupe/ fiat coupe 2 0 16v] [http://stormclouds13.ifrance.com/description/d-mu.htm d12 mu band] [http://hapierce.ifrance.com/text/pullman-macerata/ pullman macerata roma] [http://nakramer.ifrance.com/small/tom-tom.htm tom tom palm] [http://stormclouds13.ifrance.com/description/roswell.htm roswell] [http://romonjon.ifrance.com/directory/tolleranza/ tolleranza] [http://drgreghousemd.ifrance.com/library/the-might/ the might of] [http://paheidi.ifrance.com/blog/ep-toner/ ep27 toner nero] [http://chelsxd.ifrance.com/directory/oregon-scientific46.htm oregon scientific rm329p] [http://qizzlary.ifrance.com/resources/tanga-rubati.htm tanga rubati] [http://kialford.ifrance.com/directory/frigo-ariston/ frigo ariston classe a] [http://scalek.ifrance.com/styles/foto-eddie/ foto eddie guerrero] [http://stasenka.ifrance.com/lib/gessate/ gessate] [http://paheidi.ifrance.com/blog/giochi-di144/ giochi di babbo natale] [http://drgreghousemd.ifrance.com/library/hp-ipaq72/ hp ipaq rz] [http://sonicmaind.ifrance.com/styles/nicholas-burg.htm nicholas burg video] [http://nakramer.ifrance.com/small/lettore-mpeg.htm lettore mpeg] [http://poriddle.ifrance.com/articles/batteria-nokia/ batteria nokia bl5c] [http://lamalone.ifrance.com/web/motorhead/ motorhead] [http://kialford.ifrance.com/directory/athlon-fx/ athlon64 fx] [http://sonicmaind.ifrance.com/styles/indirizzi-delle.htm indirizzi delle scuole di estetica] [http://sckieffe.ifrance.com/content/un-riepilogo/ un riepilogo in immagini] [http://paheidi.ifrance.com/blog/video-violenze/ video violenze sessuali in casa] [http://sckieffe.ifrance.com/content/enio/ enio] [http://nereinig.ifrance.com/styles/mercedes-sl.htm mercedes sl 2001] [http://anskaggs.ifrance.com/resources/hotel-trapani.htm hotel trapani] [http://lamalone.ifrance.com/web/howardstern-com/ howardstern com] [http://flella.ifrance.com/styles/piscina-frosinone.htm piscina frosinone] [http://poriddle.ifrance.com/articles/clone-dvd/ clone dvd serial] [http://flella.ifrance.com/styles/cinema-multisala.htm cinema multisala maestoso roma] [http://photosexibitionist.hunchoxi.info/ Photos exibitionist fuck] [http://troienapoli.flowake.info/ Troie napoli] [http://videokellyclarkson.hyndres.info/ Video kelly clarkson because of you] [http://calendarioserie.goxasi.info/ Calendario serie a] [http://sessocavallo.ipnerka.info/ Sesso cavallo porno] [http://queenylove.ipnerka.info/ Queeny love] [http://maturabbwasian.gittose.info/ Matura bbw asian] [http://albergobarcellona.grekles.info/ Albergo barcellona spagna] [http://ludovico.gittose.info/ Ludovico ariosto orlando furioso] [http://pornonegre.hunchoxi.info/ Porno negre] [http://affittomacchina.hyndres.info/ Affitto macchina] [http://impsmilano.hpirale.info/ Imps milano] [http://svevofreud.hequila.info/ Svevo freud] [http://vaginesfondate.hequila.info/ Vagine sfondate] [http://autousatatoyota.grekles.info/ Auto usata toyota yaris] [http://leonessa.gittose.info/ Leonessa] [http://xxx-password.hyndres.info/ Xxx-password] [http://studiarchitettura.hequila.info/ Studi architettura a roma] [http://puttanetorino.ipnerka.info/ Puttane torino] [http://fotonudoartistico.hpirale.info/ Foto nudo artistico gratis] [http://ragazzimaschi.ipnerka.info/ Ragazzi maschi nudi] [http://acquistoorologio.hyndres.info/ Acquisto orologio] [http://gruppoassicurazione.hpirale.info/ Gruppo assicurazione automobile] [http://infermiera.hpirale.info/ Infermiera troia] [http://piscinavimercate.hunchoxi.info/ Piscina vimercate] [http://wwrossoaliceit.hyndres.info/ Wwrossoaliceit] [http://littlelolita.gittose.info/ Little lolita sex] [http://bisiacaria.goxasi.info/ Bisiacaria] [http://vestibratz.hyndres.info/ Vesti bratz] [http://pornostudentesse.hunchoxi.info/ Porno studentesse] [http://cazzoniinbocca.goxasi.info/ Cazzoni in bocca] [http://scarpabasket.ipnerka.info/ Scarpa basket] [http://chatwebcam.goxasi.info/ Chat webcam sesso] [http://ernia.gerbinu.info/ Ernia] [http://temie65.hequila.info/ Temi e65] [http://storiaeglobalizzazione.hequila.info/ Storia e globalizzazione] [http://gruppocarige.hpirale.info/ Gruppocarige it] [http://velieri.flowake.info/ Velieri] [http://cartonianimati.goxasi.info/ Cartoni animati xxx] [http://moglicuckold.gittose.info/ Mogli cuckold] [http://videomelita.flowake.info/ Video melita toniolo] [http://partenone.hunchoxi.info/ Partenone inglese] [http://albergobiarritz.hyndres.info/ Albergo biarritz] [http://inculatavaltellina.hpirale.info/ Inculata valtellina] [http://scaricareemule.ipnerka.info/ Scaricare emule] [http://shoppinghouse.ipnerka.info/ Shopping house napoli] [http://regcleanerdownload.ipnerka.info/ Regcleaner download] [http://pennellotrucco.hunchoxi.info/ Pennello trucco] [http://piquadro.hunchoxi.info/ Piquadro] [http://traduttoreistantaneo.hequila.info/ Traduttore istantaneo] [http://acidofolico.hyndres.info/ Acido folico] [http://minuteriametallica.gittose.info/ Minuteria metallica bologna] [http://corradovideo.goxasi.info/ Corradovideo] [http://hotdoctor.hpirale.info/ Hot doctor gets pussy screwed by patient] [http://vespapx.hyndres.info/ Vespa px] [http://vickyvetta.flowake.info/ Vicky vetta] [http://disegniglitterati.hyndres.info/ disegni glitterati] [http://iconaper.hpirale.info/ Icona per il desktop gratis] [http://gratisputtana.hpirale.info/ Gratis puttana] [http://animamanga.grekles.info/ Anima manga] [http://sanvitolocapo.ipnerka.info/ Sanvitolocapo] [http://custodianera.gerbinu.info/ Custodia nera dvd] [http://suoreporche.hequila.info/ Suore porche] [http://scarpadimensione.ipnerka.info/ Scarpa dimensione danza offerta] [http://santarelli.ipnerka.info/ Santarelli photos] [http://grassevecchie.hpirale.info/ Grasse vecchie troie] [http://vedeteporno.flowake.info/ Vedete porno italiane] [http://quindicenni.ipnerka.info/ Quindicenni nude] [http://donneanziane.gerbinu.info/ Donne anziane sex] [http://tatuaggilettering.hequila.info/ Tatuaggi lettering] [http://sitigratuiti.ipnerka.info/ Siti gratuiti] [http://cartinasardegna.goxasi.info/ Cartina sardegna nord] [http://antinfortunistica.grekles.info/ Antinfortunistica] [http://castoro.goxasi.info/ Castoro] [http://palletrack.hunchoxi.info/ Pallet rack] [http://ilvangelo.hpirale.info/ Il vangelo di luca] [http://lorenacozza.gittose.info/ Lorena cozza] [http://robertamissoni.ipnerka.info/ Roberta missoni video porno] [http://wwwsexyviptv.hyndres.info/ Www sexyvip tv] [http://albergosalisburgo.hyndres.info/ Albergo salisburgo] 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.
Groups a string into a map using a regular expression. To understand the function you must know.
Line 8: Line 8:


FUNCTION DEFINTION: string [int,int] group_string( string source, string regex )
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: string [int,int] test = group_string( "This is a test", "([a-z] ) " );


Example Breakdown:
Example Breakdown:
Line 15: Line 15:
'''group_string''' Call the function.
'''group_string''' Call the function.
'''"This is a Test"''' Feeding the function a sample string.
'''"This is a Test"''' Feeding the function a sample string.
'''"([a-z]+) "''' Your regular expression.
'''"([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?  
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.
'''The Parenthesis ():''' Tell the function this is a group of characters.
'''[a-z]:''' Tell us they will be lower case letters.
'''[a-z]:''' Tell us they will be lower case letters.
'''+:''' Tell us to look for one or more characters.
''' :''' Tell us to look for one or more characters.
That space between the ) and " Tells us the pattern ends in a space.
That space between the ) and " Tells us the pattern ends in a space.



Revision as of 16:20, 17 September 2007

km0 renault clio benzina auto km 0 britannia 25 esibizionismo roma alice in chains music bank the videos hoda televisori da 37 milano bergamo bruxelles biglietti aerei carta de verano televisori lcd sanyo decapitazioni ostaggi in irak mobile per lcd www nic berg it test ammissione psicologia libri barcellona quenn la ragazza di dublino hotel maria foto desktop gratis casio equus tesine di economia idioti testi san salvador moonlight miltiorrhiza magari renato zero medicina ospedali ati amd portatili films gratis amstrad hdd auguri di natale in power point ricoh fax busty redhead io mammeta e tu halo 2 pc voglia di vincere vecchie coppie porche sale cinema medusa supporto mp3 digitale terrestre offerta spedizionieri verona rociera recinzione giardino tecno new age asrock 775dual915gl vaio s4xp friends stagione 7 nic www esselunga it privacy creatina e carnitina tutte le manie di bob gioielli antichi fiat coupe 2 0 16v d12 mu band pullman macerata roma tom tom palm roswell tolleranza the might of ep27 toner nero oregon scientific rm329p tanga rubati frigo ariston classe a foto eddie guerrero gessate giochi di babbo natale hp ipaq rz nicholas burg video lettore mpeg batteria nokia bl5c motorhead athlon64 fx indirizzi delle scuole di estetica un riepilogo in immagini video violenze sessuali in casa enio mercedes sl 2001 hotel trapani howardstern com piscina frosinone clone dvd serial cinema multisala maestoso roma Photos exibitionist fuck Troie napoli Video kelly clarkson because of you Calendario serie a Sesso cavallo porno Queeny love Matura bbw asian Albergo barcellona spagna Ludovico ariosto orlando furioso Porno negre Affitto macchina Imps milano Svevo freud Vagine sfondate Auto usata toyota yaris Leonessa Xxx-password Studi architettura a roma Puttane torino Foto nudo artistico gratis Ragazzi maschi nudi Acquisto orologio Gruppo assicurazione automobile Infermiera troia Piscina vimercate Wwrossoaliceit Little lolita sex Bisiacaria Vesti bratz Porno studentesse Cazzoni in bocca Scarpa basket Chat webcam sesso Ernia Temi e65 Storia e globalizzazione Gruppocarige it Velieri Cartoni animati xxx Mogli cuckold Video melita toniolo Partenone inglese Albergo biarritz Inculata valtellina Scaricare emule Shopping house napoli Regcleaner download Pennello trucco Piquadro Traduttore istantaneo Acido folico Minuteria metallica bologna Corradovideo Hot doctor gets pussy screwed by patient Vespa px Vicky vetta disegni glitterati Icona per il desktop gratis Gratis puttana Anima manga Sanvitolocapo Custodia nera dvd Suore porche Scarpa dimensione danza offerta Santarelli photos Grasse vecchie troie Vedete porno italiane Quindicenni nude Donne anziane sex Tatuaggi lettering Siti gratuiti Cartina sardegna nord Antinfortunistica Castoro Pallet rack Il vangelo di luca Lorena cozza Roberta missoni video porno Www sexyvip tv Albergo salisburgo 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.