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

Pages: 1-

howd oes regex work

Name: Anonymous 2008-10-20 0:19

???

Name: Anonymous 2008-10-20 0:29

they need to do way instain mother

Name: Anonymous 2008-10-20 12:36

is regex somthing like oxyclen?

Name: Anonymous 2008-10-20 16:44

regex is a high-level, general-purpose, interpreted, dynamic programming language. regex was originally developed by Larry Wall, a linguist working as a systems administrator for NASA, in 1987, as a general purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and became widely popular among programmers. Larry Wall continues to oversee development of the core language, and its newest version, regex 6.

Name: Anonymous 2008-10-20 20:12

s/regex/BRO FIST/iS

Name: Anonymous 2008-10-20 20:43

>>2
who kill thier babbys. becuse these babby cant frigth back?

Name: Anonymous 2008-10-21 5:30

Name: Anonymous 2008-10-21 13:30

REGEX, OXYCLEAR, REMOVES SPOTS IN 1 MINUITE

Name: Anonymous 2008-10-21 13:31

Finite state machines

Name: Anonymous 2008-10-21 13:32

>>6
it was on the news this mroing.

Name: Anonymous 2008-10-21 13:35

>>10
Note the distinct lack of syntax highlighting on this post.

Name: Anonymous 2008-10-21 13:39

>>11
Your this isn't as pretty as his.

Name: Anonymous 2008-10-21 13:50

>>11
your text is blurry while >>10's isn't.

Name: Anonymous 2008-10-21 14:24

>>13
Your font hinting is misconfigured while mine isn't.

Name: Anonymous 2008-10-21 15:50

>>14
Your anus is haxed while mine isn't.

Name: Anonymous 2008-10-22 2:19

>>15
Have a second look.

Name: Anonymous 2008-10-22 4:35

>>15-16
An Anus for an Anus leaves the whole world Haxed.

Name: Anonymous 2008-10-22 9:50

>>17
Oh god, no

Name: Anonymous 2008-10-22 11:44

>>14-18 massive samefag failure

Name: Anonymous 2008-10-22 12:08

>>19
hax my anus

Name: HMA FAN 2008-10-22 13:05

>>1-20
A++ would keikaku again

Name: Anonymous 2008-10-22 13:36

>>19
Massive samefag detection failure

Name: Anonymous 2008-10-22 20:01

  
“    An Anus for an Anus leaves the whole world Haxed.    ”

~ >>17

Name: Anonymous 2008-10-22 22:14

>>22
Butthurt detected samefag. Failure.

Name: Anonymous 2008-10-22 23:21

>>19,24
back to /b/, please?

Name: Anonymous 2008-10-23 1:12

>>25
You must be new here.

>>19,24
back to /b/, please.

Name: Anonymous 2008-10-23 12:17

>>25

dude wheres my car?




















http://www.doomcade.com

Name: Anonymous 2008-10-24 6:52

couldn't find anyone actually answering ur question so basically regexp on the implementation level is the most basic shit you can do in programming, loop each character and check it, then check it again when you loop to the second character and so on

look at the source code for perl's regexp sometime, it tells you a lot about how stuff like this is done, there are some while loops in there spanning over thousands of lines, all to process each character and the overall syntax in your regexp

if you don't understand that very basic explanation then gtfo

Name: Anonymous 2008-10-24 9:47

>>28
Actually, it's a bit more complicated than that.

Name: Anonymous 2008-10-24 11:33

Perl's RE parser sucks.
It's fast as hell for some things, but it's really shitty for others and its implementation is horrible.

Try this:
http://swtch.com/~rsc/regexp/regexp1.html

Name: Anonymous 2008-10-24 11:54

>>30
I think that paper is a bit dated. Last I heard, Perl's regexes fell back on a NFA-based evaluator when none of the Perl regex extensions (lookaheads, etc) are used. That said, I have no citations for this. Re-running those experiments is probably the easiest way to verify/disprove the claim.

Name: Anonymous 2008-10-24 12:00

>>31
I've tried it. Still slow as fuck.

Name: Anonymous 2008-10-24 12:39

btw, here's the code I tested them with. I didn't bother adapting all of the tests since this pretty much gets the point across anyway, but it shouldn't be hard to do.


#!/bin/sh

testperl() {
    perl -le "'$1' =~ /$2/ or print 'wrong result'"
}

testawk() {
    echo $1 | awk "/$2/ {m = 1} END {if (! m) print \"wrong result\"}"
}

testpython() {
    python -c "if not __import__('re').search(r'$2', '$1'): print 'wrong result'"
}

repeat() {
    r=$1
    e="$2"
    while [ $r -gt 0 ]; do
        r=`expr $r - 1`
        echo -n "$e"
    done
    echo
}

# adapt these as you like, but 25 is sufficently enough to show how bad perl sucks at this
for n in 1 5 10 20 25; do
    i=`repeat $n a`
    r=`repeat $n a\?`$i
    echo n = $n
    for body in awk perl python
    do
        echo "$body":
        time test$body $i $r
    done
    echo
done

Name: Anonymous 2008-10-24 23:35

>>31
From that paper, ``As of Perl 5.6, Perl's regular expression engine is said to memoize the recursive backtracking search, which should, at some memory cost, keep the search from taking exponential amounts of time unless backreferences are being used.''.

Name: Anonymous 2008-10-25 0:07

Try SquirrelFish Extreme.

Name: Anonymous 2008-10-25 14:22

>>34
Did you run the test? I'm guessing not.

Name: Anonymous 2008-10-26 2:02

HOW IS BABBY FORMED
HOW GIRL GET PRAGNENT

Name: Anonymous 2008-10-26 14:44

>>33
That sure is a nice way to test how long it takes to launch each interpreter.

Name: Anonymous 2008-10-26 19:30

>>38
I'm sure it would be, if the individual tests didn't take upwards of several minutes for longer strings. See >>36.

Name: Anonymous 2008-10-26 19:36

[quote]I am now failing at quote tags for no reason.[/quote]

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