Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
TxTechnician ( TxTechnician@lemmy.ml )  to Programmer Humor@lemmy.ml · 3 years ago

Proof that Regex is Hate Speech!

message-square
message-square
19
link
fedilink
162
message-square

Proof that Regex is Hate Speech!

TxTechnician ( TxTechnician@lemmy.ml )  to Programmer Humor@lemmy.ml · 3 years ago
message-square
19
link
fedilink

alert-triangle
You must log in or register to comment.
  • cmnybo ( cmnybo@discuss.tchncs.de ) 
    link
    fedilink
    English
    arrow-up
    44
    ·
    3 years ago

    This is proof that regex even confuses the bots.

  • meow ( backhdlp@lemmy.blahaj.zone ) 
    link
    fedilink
    arrow-up
    27
    ·
    3 years ago

    I still don’t understand regex at all

    • d_k_bo ( d_k_bo@feddit.de ) 
      link
      fedilink
      arrow-up
      39
      ·
      3 years ago

      I recommend using https://regex101.com/

      It explains all parts of your regex and highlights all matches in your example text. I usually add a comment to a regex101 playground if I use a regex in code.

      • Aniki 🌱🌿 ( aniki@lemm.ee ) BannedBanned
        link
        fedilink
        English
        arrow-up
        6
        ·
        edit-2
        3 years ago

        Removed by mod

        • doostein ( doostein@beehaw.org ) 
          link
          fedilink
          arrow-up
          6
          ·
          3 years ago

          I disagree. I found it to be incredibly useful when I knew what regex was and that I needed it, but I couldn’t piece together a single string with it.

    • 18107 ( 18107@aussie.zone ) 
      link
      fedilink
      arrow-up
      23
      ·
      3 years ago

      The plural of regex is regrets.

    • FUsername ( FUsername@feddit.de ) 
      link
      fedilink
      arrow-up
      16
      ·
      3 years ago

      My guess is, that someone started with a small share of features to find a simple solution for the problem, but the complexity of the problem got waaaay out of hand.

      • Prunebutt ( Prunebutt@feddit.de ) 
        link
        fedilink
        arrow-up
        17
        ·
        3 years ago

        Regexes are actually used in formal computer science (if that’s the right term), i.e. “proof that this and that algorithm won’t deadlock” or something like that.

        They’re actually really elegant and can cover a lot. But you’ll have to learn them by using them.

        • naptera ( naptera@feddit.de ) 
          link
          fedilink
          arrow-up
          4
          ·
          3 years ago

          For the purpose of algorithm verification, the final and/or pushdown automaton or probably sometimes even Turing Machines are used, because they are easier to work with. “Real” regular expressions are only nice to write a grammar for regular languages which can be easily interpreted by the computer I think. The thing is, that regexs in the *nix and programming language world are also used for searching which is why there are additional special characters to indicate things like: “it has to end with …” and there are shortcuts for when you want that a character or sequence occurs

          • at least once,
          • once or never or
          • a specified number of times back to back.

          In “standard” regex, you would only have

          • () for grouping,
          • * for 0 or any number of occurances (so a* means blank or a or aa or …)
          • + as combining two characters/groups with exclusive or (in programming, a+ is mostly the same as aa* so this is a difference)
          • and sometimes some way to have a shortcut for (a+b+c+…+z) if you want to allow any lower case character as the next one

          So there are only 4 characters which have the same expressive power as the extended syntax with the exception of not being able to indicate, that it should occur at the end or beginning of a string/line (which could even be removed if one would have implemented different functions or options for the tools we now have instead)

          So one could say that *nix regex is bloated /s

    • Nougat ( Nougat@kbin.social ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      Nobody does.

      • Aniki 🌱🌿 ( aniki@lemm.ee ) BannedBanned
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        3 years ago

        Removed by mod

    • Aniki 🌱🌿 ( aniki@lemm.ee ) BannedBanned
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      3 years ago

      Removed by mod

    • Norgur ( Norgur@kbin.social ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      //////?-.,", duh,?!

    • kubica ( kubica@kbin.social ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      deleted by creator

  • umbraroze ( umbraroze@kbin.social ) 
    link
    fedilink
    arrow-up
    21
    ·
    3 years ago

    Error in Moderation

    Could have been worse. Could have been an Error in Excess.

  • IronKrill ( IronKrill@lemmy.ca ) 
    link
    fedilink
    arrow-up
    20
    ·
    3 years ago

    Regex’s are not something you need AI for as there are already tools that explain them for you. Use regexr.com or a similar tool.

    • corsicanguppy ( corsicanguppy@lemmy.ca ) 
      link
      fedilink
      arrow-up
      16
      ·
      3 years ago

      Regex’s

      Foxes

      Boxes

      Hexes

      Regexes

      You can do it. You too can pluralize without an apostrophe.

      • Malgas ( Malgas@beehaw.org ) 
        link
        fedilink
        English
        arrow-up
        6
        ·
        3 years ago

        Oxen

        Children

        Brethren

        Regexen

      • IronKrill ( IronKrill@lemmy.ca ) 
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        Thanks for pointing that out, it’s a bad habit I’ve picked up!

    • canni ( canni@lemmy.one ) 
      link
      fedilink
      arrow-up
      6
      ·
      3 years ago

      ____ are not something you need AI for as there are already tools that explain ____ for you. Use Wikipedia or a similar tool.

      • IronKrill ( IronKrill@lemmy.ca ) 
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        I don’t agree that AI has no uses, you just have to know when to use it. There are multiple times I have scoured documentation and official forums of a niche tool to few results only to ask ChatGPT and get far closer to my goal in 2 minutes than I did in 30. I know the AI has to be getting that info from somewhere, but if Google, Reddit, and a forum search can’t find it then I am sorry but I am going to ask an AI.

    • Taringano ( Taringano@lemm.ee ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      Yeha, also anything else has plenty of books and internet content on them so you really don’t need AI for those too.

  • ExLisper ( ExLisper@linux.community ) 
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    3 years ago

    You have a problem. You decide to use regex to solve it. Now you have two problems.

  • halcyondays ( halcyondays@midwest.social ) deleted by creator
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    3 years ago

    deleted by creator

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 41 users / week
  • 42 users / month
  • 1.56K users / 6 months
  • 871 local subscribers
  • 43.7K subscribers
  • 1.25K Posts
  • 10.2K Comments
  • Modlog
  • mods:
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) deleted by creator
  • cat_programmer ( cat_programmer@lemmy.ml ) 
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code