• JBert (disco)

    At least they didn't use a hash symbol to separate all those branches...

  • Zacrath (disco)

    This hurts my soul.

  • VinDuv (disco)

    [:#.$",'#-/|]? [B|b|C|c|G|g|H|h|J|j|K|k|L|l|M|m|S|s|U|u|Y|y]? How does this syntax work, exactly? The regex parser implementation must be pretty interesting...

  • Zacrath (disco)

    [B|b|C|c|G|g|H|h|J|j|K|k|L|l|M|m|S|s|U|u|Y|y]

    I can see case-insensitivity doesn't exist here.

  • RaceProUK (disco)

    My reaction after seeing that regex: [image]

  • TheCPUWizard (disco)

    When it comes to "write only languages", APL (with the original greek character set) is still king!!!!

  • Kuro (disco)
    Comment held for moderation.
  • Zacrath (disco) in reply to Kuro
    Comment held for moderation.
  • RaceProUK (disco) in reply to Zacrath

    the system doesn’t use widely implemented “Perl-compatible regular expressions” syntax, but instead, uses its own, slightly tweaked version.

    :wtf::question: Why are they using their own syntax?

  • Kuro (disco) in reply to RaceProUK

    I suppose it's to anonymize the WTF...

    Filed Under: Or because this tweaked regex is so beautiful

  • Zacrath (disco) in reply to RaceProUK
    RaceProUK:
    >the system doesn’t use widely implemented “Perl-compatible regular expressions” syntax, but instead, **uses its own, slightly tweaked version.**

    :wtf::question: Why are they using their own syntax?

    Because they're professionals. They're too good for regular regex. They need… Enterprise regex.


    Filed under: Regular regular expressions

  • Onyx (disco) in reply to RaceProUK

    At least it's not Asterisk's "Kinda-regex thing that's grossly underpowered. PCRE? Oh, we have that as well! No, you can't use it here where you really need it, what are you, crazy?"


    Filed under: Bonus: every phone manufacturer has their own incompatible implementation. Documented in Engrish with half on an example provided

  • RFoxmich (disco)

    'Perl is jokingly referred to as a “write-only language”'

    It's no joke.

  • Zacrath (disco) in reply to RFoxmich
    RFoxmich:
    'Perl is jokingly referred to as a “write-only language”'

    It's no joke.

    Actually, there was one time when I successfully read Perl code. True story.


    Filed under Myth Busted

  • RaceProUK (disco) in reply to Zacrath
    Zacrath:
    Actually, there was one time when I successfully read Perl code
    The 'Hello World' example doesn't count :stuck_out_tongue:
  • Yazeran (disco) in reply to RFoxmich
    Comment held for moderation.
  • mott555 (disco)

    I like regular expressions. They're handy and useful, really not that hard to understand, and the hate against them is poorly-misdirected cargo cultism. But after seeing today's article, last night's partially-digested dinner is soaking into my keyboard and the submitter owes me a new one.

  • powerlord (disco)

    So, was the keyboard still able to be used after it got sat on or did they need to get a new one?

  • PJH (disco) in reply to Kuro
    Comment held for moderation.
  • boomzilla (disco)

    Does the regex take more or less than 2 minutes to compile?

  • hungrier (disco) in reply to boomzilla

    I dunno but it is definitely bigger than a bread box.

  • Salamander (disco)
    Comment held for moderation.
  • chreng (disco) in reply to mott555

    You might want to invest in a keyboard like this. It can be rinsed under water after such incidents:

    [image]
  • operagost (disco)

    If that's not Codethulu, I don't know what is.

  • flabdablet (disco) in reply to chreng
    chreng:
    It can be rinsed under water

    Most keyboards survive a trip through the dishwasher quite well, as long as you don't use detergent and give them a week to dry out again before plugging them back in.

  • operagost (disco) in reply to RaceProUK

    Doctor, I feel sharp pain every morning when I put on my slippers. Any idea what it might be?

  • flabdablet (disco) in reply to VinDuv
    VinDuv:
    [:#.$",'#-/|]? [B|b|C|c|G|g|H|h|J|j|K|k|L|l|M|m|S|s|U|u|Y|y]? How does this syntax work, exactly?

    Well, either they're using a nonstandard regex parser that overloads the [ ] operator to mean both "character class match" and "non-capturing group to limit the scope of the | operator", or whoever wrote that regex doesn't really understand how character classes work.

    It would be interesting to run the big ugly regex against input containing a lot of | characters to see if it matches a whole bunch of things it shouldn't. And by "interesting" I mean "something it would be amusing to hear about over morning coffee" as opposed to "something I am even vaguely motivated to do myself".

  • dkf (disco) in reply to flabdablet
    flabdablet:
    whoever wrote that regex doesn't really understand how character classes work.

    My bet is on this one. :ive_seen_some_things.dll:

  • herby (disco)

    Yes, regular expressions are nice, but if they take up more than a line (for various definitions of line) they become VERY write only. If you want the next guy (or yourself in 6 months) to understand it, keep it SHORT!

    Obviously this wasn't a consideration for the expression in the article. The author should be kicked to the curb!

  • mott555 (disco) in reply to chreng

    That doesn't look clicky enough.

  • oesor (disco) in reply to Yazeran
    Comment held for moderation.
  • JBert (disco) in reply to flabdablet
    Comment held for moderation.
  • dkf (disco) in reply to JBert
    JBert:
    Even the trusty IBM Model M can have water seeping into the conductive layers, and I don't think those will dry unless you take them apart.
    Bake in an autoclave for a while.
  • anonymous234 (disco) in reply to Zacrath
    Zacrath:
    Because they're professionals. They're too good for regular regex. They need… Enterpriseadvanced regex.
    [image]
  • anonymous234 (disco) in reply to mott555

    I think people are often too afraid to actually parse text into tokens, you know, take advantage of actual loops and conditionals that computers are good at, rather than limiting themselves to a mathematical model of computers (nondeterministic finite automatons) that's often too limited and hard to think about. Maybe programming languages don't make it as easy as it should.

  • Zylon (disco)
    TDWTF:
    "Perl is jokingly referred to as a “write-only language”. This is because Perl’s primary solution to any problem is to throw a regular expression at it."
    False. Perl has this reputation because of its dense, cryptic, shortcut-loving syntax. Insanely complicated regexes can be written in any language.
  • PWolff (disco) in reply to Kuro
    Comment held for moderation.
  • John_Imrie (disco) in reply to oesor

    I think you can sanitise that even more by using qr() instead of ""

  • Maciejasjmj (disco) in reply to oesor
    Comment held for moderation.
  • Gurth (disco) in reply to herby
    herby:
    Yes, regular expressions are nice, but if they take up more than a line (for various definitions of line) they become VERY write only.
    This makes them fun to use in InDesign, where the text box for the regex for a GREP style (character formatting that’ll be applied to what the regex matches) is maybe 30 characters wide, so if you’re trying to do anything more complex than matching some characters — like doing lookbehinds and lookaheads — you’ll often find yourself not being able to even see the whole regex.

    Add some poor UI design (or a bug, not sure what it is) so that if you press left arrow key when the insertion point is at the end of the text box (not the end of the regex), the box contents scroll right as well as moving the insertion point — keeping the insertion point at the end, so you can’t see what’s to the right of it. Oh, and a minor bug which makes the arrow keys not move the insertion point at all if you’ve changed focus from InDesign and back while the style edit window is open.

  • Masaaki_Hosoi (disco)
    Comment held for moderation.
  • Matt_Westwood (disco)

    Okay, so take a closer look at the start of this regex ...

    ([:-.,;/\

    That's not actually a regex -- it's an emoticon of someone puking up.

  • Onyx (disco) in reply to dkf
    dkf:
    :ive_seen_some_things.dll:

    I wrote a regex that parses a regex and runs it part by part because the only function that supports regexes can only handle a single backreference...

    :ive_done_some_things.deleteme:

  • CoyneTheDup (disco) in reply to operagost
    TheCPUWizard:
    When it comes to "write only languages", APL (with the original greek character set) is still king!!!!

    Wrong-o! APL is quite understandable once you get used to it. Just read right to left and the import of any statement is mathematically clear.

    This stuff goes ...well I don't know how it goes ... I don't think this is even anchored to our universe.

    Not to mention that it gives one a ... contaminated feeling...

    Case in point:

    chreng:
    You might want to invest in a keyboard like this. It can be rinsed under water after such incidents:

    See, at least APL is clean, if a little dense. This is: Unclean! Unclean!

    How unclean?

    operagost:
    If that's not Codethulu, I don't know what is.

    See? Really, really: Unclean!

  • Maciejasjmj (disco) in reply to CoyneTheDup
    Comment held for moderation.
  • kupfernigk (disco) in reply to anonymous234
    anonymous234:
    I think people are often too afraid to actually parse text into tokens, you know, take advantage of actual loops and conditionals that computers are good at

    It certainly is possible to do it and it can be much more easily maintainable, because the logic can be made explicit and so can the tokens. The difficulty is that the next person along the line may not be the kind of programmer that understands natural language parsing, whereas so many think that regexes are kewl. And they will then be faced with the need to extend the model and start trying to use regexes, thus producing a complete fustercluck.

  • dkf (disco) in reply to Maciejasjmj
    Maciejasjmj:
    Corollary: this can be extended to any other language.

    Has anyone ported PCRE to Brainfuck yet?

  • Onyx (disco)

    Are we going to have a fight about who used / knows the worst language?

    No PHP, that's no fair, like Chuck Norris.

  • Maciejasjmj (disco)
    kupfernigk:
    and I don't want to turn into an orangutan
    Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
    Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
    Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
    Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
    Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
    Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
    Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
    Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
    Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
    
  • kupfernigk (disco) in reply to Maciejasjmj

    You lost me at "Ook!", could you provide a little contextualisation? Or a banana?

Leave a comment on “Regularly Expressing Hate”

Log In or post as a guest

Replying to comment #:

« Return to Article