Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Text parsing

Name: Anonymous 2014-04-16 11:26

Hey guys suppose I have an application that is fed the body of my post. Now my post might contain quotations such as
>>8
>>3-7
>>2,3,4
>>7-8,2,5,10-12
It also may have quotations mid-text such as >>42.

Now, I want the result of my application to be
2 3 4 5 6 7 8 10 11 12
.
Notice 42 is missing because it was midtext.

How would you code that? (Before you laugh and say it's trivial - it is, but I want to code it).

I figured, maybe I will use perl. But maybe not. Since it's been a lot of time since I coded, I want to use something that is funky to code it. Perhaps factor, or J. Well, that's my shitty thread, thanks for reading.

Name: Anonymous 2014-04-17 13:40

>>15,16
Does it sanitize input? What happens to quotes like
>>1,a
In particular I am worrying about eval($_). It's a nice idea to replace 1-5 with 1..5, but how exactly does this work? Since print 1..5 produces 12345 and not 1 2 3 4 5.

I guess @r is the array that you use to store the numbers and later sort. But how do you make the numbers unique in it? What's the grep statement doing? Is $u a hashtable? I don't understand bawwwwwww

Name: Anonymous 2014-04-17 13:46

>>17
AHa! You use grep later to make the search unique! How the hell does grep know which variable we're searching?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List