Talk:String Handling Routines: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Kidoblivious
mNo edit summary
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://eyeh8everywon.50webs.com/pt-cruiser8.htm pt cruiser 22] [http://rzd.50webs.com/www-cislscuola/ www cislscuola lombardia it] [http://rjdudak.50webs.com/description/uomo-in5.htm uomo in casa] [http://lovereceiver.50webs.com/description/Orsi-gay1/ orsi gay] [http://greenquotebook.50webs.com/shandi.htm shandi] [http://rjdudak.50webs.com/description/audi-a118.htm audi a3 130] [http://rjdudak.50webs.com/description/jail-bird.htm jail bird man] [http://kagomeshuko.50webs.com/text/esopo/ esopo] [http://rzd.50webs.com/cucina-a/ cucina a legna] [http://greenquotebook.50webs.com/festa-a.htm festa a hollywood per xbox live] [http://mentalitch.50webs.com/topic/ca-phe.htm ca phe thanh da] [http://lesliesecho.50webs.com/grundig-satellit.html grundig satellit] [http://amandab.50webs.com/blog/unnao/ unnao] [http://amandab.50webs.com/blog/quark-xpress3/ quark xpress 6 patch] [http://efrosine.50webs.com/directory/monitor-70/ monitor 17 sony s] [http://lavinyacreates.50webs.com/html/walter-tobagi/ walter tobagi] [http://deedeecam.50webs.com/blog/km-28/ km 0 tv 185] [http://helenadole.50webs.com/modica-it.htm modica it] [http://moxivad.50webs.com/web/auto-lexus.html auto lexus] [http://mentalitch.50webs.com/topic/www-alldatazz1.htm www alldatazz com] [http://piraticalman.50webs.com/dpi-tavolette.html dpi tavolette grafiche] [http://rjdudak.50webs.com/description/takie-czarne.htm takie czarne oczy] [http://greenquotebook.50webs.com/gorilla-nebbia.htm gorilla nebbia] [http://lavinyacreates.50webs.com/html/ostrica/ ostrica] [http://greenquotebook.50webs.com/pedali-ciclismo.htm pedali ciclismo] [http://greenquotebook.50webs.com/longwood.htm longwood] [http://piraticalman.50webs.com/acer50.html acer 1600] [http://lovereceiver.50webs.com/description/ludwig-van10/ ludwig van beethoven piano concertos n 2 4] [http://moxivad.50webs.com/web/camera-savona.html camera savona] [http://deedeecam.50webs.com/blog/rischioso-inganno/ rischioso inganno] [http://ammjong.50webs.com/web/chario-premium.html chario premium] [http://rjdudak.50webs.com/description/get-tangled.htm get tangled up in me] [http://viktoza.50webs.com/new/win-mx9/ win mx in itaiano] [http://piraticalman.50webs.com/conoscere-ragazza.html conoscere ragazza russa] [http://lovereceiver.50webs.com/description/robbie-williams27/ robbie williams music box biographical collection] [http://mentalitch.50webs.com/topic/televisori-lcd56.htm televisori lcd philips pixel plus 2] [http://kagomeshuko.50webs.com/text/www-goglee/ www goglee om] [http://lovereceiver.50webs.com/description/kthd/ kthd530 512] [http://moxivad.50webs.com/web/www-marinamilitare.html www marinamilitare it] [http://efrosine.50webs.com/directory/oroscopo-settimanale/ oroscopo settimanale] [http://helenadole.50webs.com/huey-p.htm huey p newton] [http://kagomeshuko.50webs.com/text/wireless-bridge2/ wireless bridge] [http://mirnaladonyax.50webs.com/data/dudinka.html dudinka] [http://kagomeshuko.50webs.com/text/ich-liebe/ ich liebe deutsche land] [http://lavinyacreates.50webs.com/html/nord-sud1/ nord sud ovest] [http://piraticalman.50webs.com/etro-uomo.html etro uomo] [http://moxivad.50webs.com/web/yentai.html yentai] [http://viktoza.50webs.com/new/fotografa/ fotografa] [http://efrosine.50webs.com/directory/rony-size/ rony size] [http://helenadole.50webs.com/nen-jiang.htm nen jiang] [http://rzd.50webs.com/backstreet-boys10/ backstreet boys dvd] [http://amandab.50webs.com/blog/murolo-roberto/ murolo roberto] [http://vanatru.50webs.com/new/safri-duo4/ safri duo all the people in the world] [http://lesliesecho.50webs.com/in-vacanza3.html in vacanza da una vita] [http://amandab.50webs.com/blog/canciones-de16/ canciones de avril lavigne] [http://rzd.50webs.com/la-boutique/ la boutique della casa] [http://helenadole.50webs.com/biglietti-falsi.htm biglietti falsi vasco] [http://mirnaladonyax.50webs.com/data/epson-c23.html epson c62 cartuccia] [http://helenadole.50webs.com/ragazza-giapponesi.htm ragazza giapponesi gratis] [http://lavinyacreates.50webs.com/html/frigoriferi-rex7/ frigoriferi rex rd 20 s] [http://moxivad.50webs.com/web/mani-di2.html mani di fata it] [http://greenquotebook.50webs.com/aiwa-radio.htm aiwa radio] [http://lovereceiver.50webs.com/description/sistema-solare/ sistema solare] [http://mirnaladonyax.50webs.com/data/katia-nuda1.html katia nuda del grande fratello] [http://eyeh8everywon.50webs.com/santa-fe5.htm santa fe hotel] [http://rjdudak.50webs.com/description/capitan-kidd.htm capitan kidd] [http://lavinyacreates.50webs.com/html/adidas-adi1/ adidas adi racer low] [http://vanatru.50webs.com/new/exilim-z7/ exilim z40] [http://missmane.50webs.com/schede-madri71/ schede madri amd dfi] [http://amandab.50webs.com/blog/profumi-maschili/ profumi maschili] [http://mirnaladonyax.50webs.com/data/wright-basil.html wright basil] [http://ammjong.50webs.com/web/testo-di115.html testo di magica la notte] [http://eyeh8everywon.50webs.com/caps-serena.htm caps serena grandi] [http://lavinyacreates.50webs.com/html/transceiver-aui/ transceiver aui rj 45] [http://mentalitch.50webs.com/topic/raccoglitori-a1.htm raccoglitori a 3 anelli] [http://mentalitch.50webs.com/topic/big-air.htm big air] [http://missmane.50webs.com/pian-dei/ pian dei cortini] [http://amandab.50webs.com/blog/vernale/ vernale] [http://mirnaladonyax.50webs.com/data/elda-locatelli.html elda locatelli] [http://efrosine.50webs.com/directory/fotografia-de1/ fotografia de mujeres negras de africa] [http://kagomeshuko.50webs.com/text/siemens-s6/ siemens s 440] [http://moxivad.50webs.com/web/missa.html missa] [http://vanatru.50webs.com/new/nissan-ravenna/ nissan ravenna] [http://viktoza.50webs.com/new/orchstra/ orchstra] [http://efrosine.50webs.com/directory/far-cry2/ far cry soluzione] [http://ammjong.50webs.com/web/stajl.html stajl] [http://viktoza.50webs.com/new/www-folha1/ www folha com] [http://lesliesecho.50webs.com/sanaga-haute.html sanaga haute] [http://ammjong.50webs.com/web/freud-prodotti1.html freud prodotti punte seghe] [http://mirnaladonyax.50webs.com/data/ecommerce-shopping.html ecommerce shopping cart] [http://helenadole.50webs.com/vanbasco-s.htm vanbasco s karaoke player] [http://piraticalman.50webs.com/hp-centrino4.html hp centrino 1 5ghz] [http://amandab.50webs.com/blog/vivavoce-panasonic/ vivavoce panasonic] [http://lesliesecho.50webs.com/scuola-danza1.html scuola danza classica torino] [http://rjdudak.50webs.com/description/tomtom-go20.htm tomtom go mappe] [http://lovereceiver.50webs.com/description/karlfeldt-erik/ karlfeldt erik axel] [http://missmane.50webs.com/server-stampa/ server stampa] [http://moxivad.50webs.com/web/canon61.html canon 580] [http://vanatru.50webs.com/new/mi-ritorni/ mi ritorni in mente] [http://lovereceiver.50webs.com/description/rsmmc-per3/ rsmmc per nokia 6680] [http://greenpoint.50webs.com/html/i-prova/ i prova scritta esame di stato] [http://greenpoint.50webs.com/html/olympus-camedia9/ olympus camedia c 360 zoom] [http://scruffytom.50webs.com/topic/geforce-ultra.html geforce ultra sli] [http://jennygray.50webs.com/blog/bilbana/ bilbana] [http://jimmymnemonic.50webs.com/pc-dekstop.html pc dekstop] [http://poetoams.50webs.com/web/hotel-a12/ hotel a rovaniemi] [http://jimmymnemonic.50webs.com/consumption-junction.html consumption junction] [http://revjo.50webs.com/view/bmw-k1/ bmw k 1100] [http://missirish9.50webs.com/giornale-la.htm giornale la sicilia] [http://annetinternet.50webs.com/lib/spartiti-dei.htm spartiti dei led zeppelin] [http://sirpengalot.50webs.com/mtc/ mtc] [http://annetinternet.50webs.com/lib/calendario-8.htm calendario 2006 francesco arca] [http://sirpengalot.50webs.com/entra-subito/ entra subito] [http://anga12.50webs.com/content/studio-mediasuite/ studio mediasuite] [http://sirpengalot.50webs.com/s3/ s 40] [http://revjo.50webs.com/view/bruciore-piede/ bruciore piede sinistro] [http://agarvey.50webs.com/blog/notizia-e.htm notizia e media] [http://poetoams.50webs.com/web/ragazzo-bello/ ragazzo bello foto] [http://chaoticide.50webs.com/text/get-out/ get out jojo] [http://missirish9.50webs.com/noce-moscata.htm noce moscata] [http://almightyshippo.50webs.com/web/vocabolario-cinese.html vocabolario cinese] [http://poetoams.50webs.com/web/albergo-economici2/ albergo economici atene] [http://poetoams.50webs.com/web/mezzogiorno-e/ mezzogiorno e mezzo di fuoco] [http://poetofdreams.50webs.com/blog/amore-psiche.html amore psiche] [http://revjo.50webs.com/view/software-mac/ software mac] [http://anga12.50webs.com/content/ricetta-tarallo/ ricetta tarallo] [http://wannachange.50webs.com/content/auto-cross/ auto cross] [http://jimmymnemonic.50webs.com/annuncio-telefono.html annuncio telefono] [http://anga12.50webs.com/content/to-name/ to name ai] [http://watchmegirls.50webs.com/topic/manga-porno2.htm manga porno gratuiti] [http://missirish9.50webs.com/photos-pac.htm photos 2pac] [http://sirpengalot.50webs.com/midland2/ midland 18] [http://chaoticide.50webs.com/text/gods/ gods] [http://wannachange.50webs.com/content/esercitazioni-di/ esercitazioni di analisi matematica 1] [http://nonsmoker.50webs.com/data/pre-pagato.htm pre pagato mobile] [http://poetofdreams.50webs.com/blog/il-libraccio.html il libraccio] [http://scruffytom.50webs.com/topic/nomadi-del.html nomadi del canto] [http://poetofdreams.50webs.com/blog/foto-annuncio6.html foto annuncio coppia] [http://deeahblita.50webs.com/heil-tweeter/ heil tweeter] [http://nonsmoker.50webs.com/data/assicurazione-modena.htm assicurazione modena] [http://poetofdreams.50webs.com/blog/faenza.html faenza] [http://sirpengalot.50webs.com/bajar-musica1/ bajar musica regueton] [http://insomniashe.50webs.com/data/infradito-sundek/ infradito sundek] [http://chaoticide.50webs.com/text/stcc/ stcc] [http://scruffytom.50webs.com/topic/driver-motorola13.html driver motorola c450] [http://annetinternet.50webs.com/lib/athlon-18.htm athlon 64 3200 venice tray] [http://almightyshippo.50webs.com/web/immagini-festa.html immagini festa della mamma] [http://agarvey.50webs.com/blog/brigantino.htm brigantino] [http://revjo.50webs.com/view/nino-besozzi/ nino besozzi] [http://agarvey.50webs.com/blog/la-strada5.htm la strada del crimine] [http://scruffytom.50webs.com/topic/opere-di3.html opere di salvatore quasimodo] [http://anga12.50webs.com/content/tiki-thong/ tiki thong] [http://jennygray.50webs.com/blog/alice-oggi/ alice oggi] [http://watchmegirls.50webs.com/topic/il-gladiatore3.htm il gladiatore 2] [http://poetofdreams.50webs.com/blog/hp-cavo.html hp cavo alimentazione] [http://revjo.50webs.com/view/inferno-a1/ inferno a caracas] [http://poetoams.50webs.com/web/baraldi-block/ baraldi block filter] [http://chaoticide.50webs.com/text/menopon-gallinae/ menopon gallinae] [http://wannachange.50webs.com/content/www-rey/ www rey com] [http://insomniashe.50webs.com/data/historia-del2/ historia del basket] [http://anga12.50webs.com/content/daewoo-dhc/ daewoo dhc x100e] [http://annetinternet.50webs.com/lib/stampe-colorate.htm stampe colorate] [http://mingislazydork.50webs.com/slot-macchina1/ slot macchina slot] [http://watchmegirls.50webs.com/topic/borgaro.htm borgaro] [http://nonsmoker.50webs.com/data/telefono-cellulare3.htm telefono cellulare] [http://chaoticide.50webs.com/text/gamberetti-tartarughe/ gamberetti tartarughe] [http://agarvey.50webs.com/blog/www-petia.htm www petia ru] [http://sirpengalot.50webs.com/pan-store/ pan store] [http://nonsmoker.50webs.com/data/novara-hotel.htm novara hotel] [http://wannachange.50webs.com/content/download-free2/ download free video] [http://mingislazydork.50webs.com/e-io/ e io mi gioco la bambina] [http://wannachange.50webs.com/content/ministero-delle2/ ministero delle politiche agricole e for] [http://annetinternet.50webs.com/lib/biglietto-aereo13.htm biglietto aereo bilbao] [http://jimmymnemonic.50webs.com/dvd-key.html dvd key] [http://agarvey.50webs.com/blog/ivrylabataille.htm ivrylabataille] [http://jimmymnemonic.50webs.com/hoppa-hoppa.html hoppa hoppa reiter] [http://anga12.50webs.com/content/parla-piu/ parla piu piano lyrics] [http://deeahblita.50webs.com/riprese/ riprese] [http://jimmymnemonic.50webs.com/heinrich.html heinrich] [http://deeahblita.50webs.com/nudi-a/ nudi a cavallo] [http://deeahblita.50webs.com/mirc-chat/ mirc chat] [http://insomniashe.50webs.com/data/montaggio-a/ montaggio a secco] [http://poetoams.50webs.com/web/televisione-lcd2/ televisione lcd 19 pollici] [http://greenpoint.50webs.com/html/kia-carens/ kia carens 20] [http://revjo.50webs.com/view/gurgaon/ gurgaon] [http://mingislazydork.50webs.com/testo-di22/ testo di dragostea din tei] [http://nonsmoker.50webs.com/data/ht-videoproiettori.htm ht1000 videoproiettori] [http://almightyshippo.50webs.com/web/per-amore2.html per amore di poppea] [http://jennygray.50webs.com/blog/caldaie-vai/ caldaie vai] [http://mingislazydork.50webs.com/gianna-freccia/ gianna freccia] [http://jimmymnemonic.50webs.com/rainbow-miles.html rainbow miles] [http://watchmegirls.50webs.com/topic/ogliastra-servizi.htm ogliastra servizi marittimi] [http://poetofdreams.50webs.com/blog/futurama-xxx.html futurama xxx] [http://missirish9.50webs.com/toscana-hotel.htm toscana hotel saturnia] [http://revjo.50webs.com/view/gold-minar/ gold minar] [http://annetinternet.50webs.com/lib/sex-miss.htm sex miss] [http://almightyshippo.50webs.com/web/ibm.html ibm 1334] [http://jimmymnemonic.50webs.com/ragazze-di5.html ragazze di campagna] [http://chaoticide.50webs.com/text/l-e/ l e luci di natale pezzali] [http://scruffytom.50webs.com/topic/dio-come.html dio come te amo] 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.

Revision as of 03:01, 24 October 2007

pt cruiser 22 www cislscuola lombardia it uomo in casa orsi gay shandi audi a3 130 jail bird man esopo cucina a legna festa a hollywood per xbox live ca phe thanh da grundig satellit unnao quark xpress 6 patch monitor 17 sony s walter tobagi km 0 tv 185 modica it auto lexus www alldatazz com dpi tavolette grafiche takie czarne oczy gorilla nebbia ostrica pedali ciclismo longwood acer 1600 ludwig van beethoven piano concertos n 2 4 camera savona rischioso inganno chario premium get tangled up in me win mx in itaiano conoscere ragazza russa robbie williams music box biographical collection televisori lcd philips pixel plus 2 www goglee om kthd530 512 www marinamilitare it oroscopo settimanale huey p newton wireless bridge dudinka ich liebe deutsche land nord sud ovest etro uomo yentai fotografa rony size nen jiang backstreet boys dvd murolo roberto safri duo all the people in the world in vacanza da una vita canciones de avril lavigne la boutique della casa biglietti falsi vasco epson c62 cartuccia ragazza giapponesi gratis frigoriferi rex rd 20 s mani di fata it aiwa radio sistema solare katia nuda del grande fratello santa fe hotel capitan kidd adidas adi racer low exilim z40 schede madri amd dfi profumi maschili wright basil testo di magica la notte caps serena grandi transceiver aui rj 45 raccoglitori a 3 anelli big air pian dei cortini vernale elda locatelli fotografia de mujeres negras de africa siemens s 440 missa nissan ravenna orchstra far cry soluzione stajl www folha com sanaga haute freud prodotti punte seghe ecommerce shopping cart vanbasco s karaoke player hp centrino 1 5ghz vivavoce panasonic scuola danza classica torino tomtom go mappe karlfeldt erik axel server stampa canon 580 mi ritorni in mente rsmmc per nokia 6680 i prova scritta esame di stato olympus camedia c 360 zoom geforce ultra sli bilbana pc dekstop hotel a rovaniemi consumption junction bmw k 1100 giornale la sicilia spartiti dei led zeppelin mtc calendario 2006 francesco arca entra subito studio mediasuite s 40 bruciore piede sinistro notizia e media ragazzo bello foto get out jojo noce moscata vocabolario cinese albergo economici atene mezzogiorno e mezzo di fuoco amore psiche software mac ricetta tarallo auto cross annuncio telefono to name ai manga porno gratuiti photos 2pac midland 18 gods esercitazioni di analisi matematica 1 pre pagato mobile il libraccio nomadi del canto foto annuncio coppia heil tweeter assicurazione modena faenza bajar musica regueton infradito sundek stcc driver motorola c450 athlon 64 3200 venice tray immagini festa della mamma brigantino nino besozzi la strada del crimine opere di salvatore quasimodo tiki thong alice oggi il gladiatore 2 hp cavo alimentazione inferno a caracas baraldi block filter menopon gallinae www rey com historia del basket daewoo dhc x100e stampe colorate slot macchina slot borgaro telefono cellulare gamberetti tartarughe www petia ru pan store novara hotel download free video e io mi gioco la bambina ministero delle politiche agricole e for biglietto aereo bilbao dvd key ivrylabataille hoppa hoppa reiter parla piu piano lyrics riprese heinrich nudi a cavallo mirc chat montaggio a secco televisione lcd 19 pollici kia carens 20 gurgaon testo di dragostea din tei ht1000 videoproiettori per amore di poppea caldaie vai gianna freccia rainbow miles ogliastra servizi marittimi futurama xxx toscana hotel saturnia gold minar sex miss ibm 1334 ragazze di campagna l e luci di natale pezzali dio come te amo 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.