• @[email protected]
    link
    fedilink
    82 years ago

    I got the “error in moderation” today today too when I asked it to make me a ghost with the beard and body type of Santa Claus. Like it knows Santa is not a real person right?

    • @[email protected]OP
      link
      fedilink
      32 years ago

      Ya, it’s a generic error from the looks of it. Didn’t know what error to throw when it went down, so it appears to have defaulted to this.

  • meow
    link
    fedilink
    422 years ago

    I still don’t understand regex at all

    • qaz
      link
      fedilink
      72 years ago

      What part do you not understand?

        • @[email protected]
          link
          fedilink
          62 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.

            • @[email protected]
              link
              fedilink
              222 years ago

              Does every Regex contain a reverse negative lookup? Do I need to know how to do a reverse negative lookup to write a Regex?

              If not, why are you asking?

                • @[email protected]
                  link
                  fedilink
                  182 years ago

                  I have written dozens upon dozens of Regexes without using reverse negative lookups, but I guess according to you I don’t really know Regexes because I haven’t used those specific features?

                  You don’t need to know all about a subject to know a subject.

    • @[email protected]
      link
      fedilink
      122 years ago

      It’s pattern-matching. Like searching *.txt to get all text files. It’s just… more. There’s symbols for matching the start of a string, the end of a string, a set of characters, repetition, etc. Very “etc.” And the syntax blows. The choices of . for match-any-character and * for zero-or-more really fuck with common expectations.

      It can also replace substrings that match. Like changing the file extension of all text files. Where it gets properly difficult is in “capture groups.” Like looking for all file extensions, and sticking a tilde after the dot. You can put parentheses around part of the pattern being matched and then reference that in the replacement. Conceptually simple - pain in the ass to use properly - syntax both sucks and blows.

      Lookahead is what you do to match “ass” but not “assault.” I refuse to elaborate further.

    • @[email protected]
      link
      fedilink
      162 years ago

      It’s really not too bad as long as:

      • you use a proper IDE (e.g. Regex101) with highlighting and piecewise explanations

      • you use named capturing groups

      • you give the regex a descriptive name in your code

              • @[email protected]
                link
                fedilink
                122 years ago

                He’s a troll. He said earlier today that the holocaust wasn’t bad because “not all the jews died”

                He’s just trying to pick a fight

              • @[email protected]
                link
                fedilink
                12 years ago

                I am, and I can think of many cases where plain dumb string matching since you know what you’re dealing with beats regex in both performance and maintainability.

                You’re a clown that wouldn’t know how to compare two strings without regex even if you got paid 6 figures to do it.

                • @[email protected]
                  link
                  fedilink
                  32 years ago

                  There’s a lot of use cases where regex makes a lot of sense: complex log parsing, determining if a value entered is a valid phone number or email, syntax highlighting, data validation in ML preprocessing, etc. A lot of languages also come with certain features that allow regex to be more efficient than dumb string matching, such as the ability to pre-compile patterns and the flexibility of being able to choose between deterministic and non-deterministic finite automata, should you need efficiency for one use case and flexibility for another. It really depends on what you’re designing and how it’s going to be used, of course.

    • @[email protected]
      link
      fedilink
      252 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.

      • @[email protected]
        link
        fedilink
        242 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.

        • @[email protected]
          link
          fedilink
          32 years ago

          You are probably thinking of Temporal logic which allows us to model if algorithms and programs terminate etc! It can be represented by using state machines tho!

          • @[email protected]
            link
            fedilink
            22 years ago

            It’s been a while, so I’m quite rusty, especiallyeon the terminology, but I think we modelled feasible sequences of finite and infinite state machines using regexes.

            That’s how I was forced to learn 'em in uni. ;)

            • @[email protected]
              link
              fedilink
              22 years ago

              Ohhh I must be confusing the two! But yea, Regex is just NDAs in text form! The course I have had on it is one of my favorites! Really fun stuff

        • @[email protected]
          link
          fedilink
          5
          edit-2
          2 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

      • @[email protected]
        link
        fedilink
        202 years ago

        Regex is actually just a way to write (Epsilon) non determistic state automata(ε-NDA) using text! ε-NDA comes from automata theory and they are just a somewhat powerful way to describe state machines! They can kind of be seen as a stepping stone to things like Context-Free Grammars which is what language parsers use to define their language/parsers, and Turing machines! Regex is a fundamental part of computer science, and they are of course incredibly useful in string validation due to their expressive power! If you study at uni and get the chance to take a course in automata theory I recommend it! Personal favorite subject :)

  • @[email protected]
    link
    fedilink
    English
    15
    edit-2
    2 years ago

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

    • @[email protected]
      link
      fedilink
      82 years ago

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

      • @[email protected]
        link
        fedilink
        1
        edit-2
        2 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.

    • @[email protected]
      link
      fedilink
      192 years ago

      Regex’s

      Foxes

      Boxes

      Hexes

      Regexes

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

      • @[email protected]
        link
        fedilink
        42 years ago

        I’ve begun to understand that the modern meaning of an apostrophe is “oh shit! Here comes an ‘s’”.

        Sadly, I am gradually growing okay with that idea.

    • @[email protected]
      link
      fedilink
      32 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.

    • @[email protected]
      link
      fedilink
      12 years ago

      Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference

      With an explanation like this, I thing I’ll take the AI.

  • umbraroze
    link
    fedilink
    382 years ago

    Error in Moderation

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