Content Warning

CONTENT WARNING

You may view NSFW content!

If you are under 18 years old you are not allowed to continue!

Lemmy.NRDBLG.de
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cannedtuna@lemmy.world to memes@lemmy.worldEnglish · 7 days ago

Expressions

lemmy.world

message-square
22
link
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
471

Expressions

lemmy.world

cannedtuna@lemmy.world to memes@lemmy.worldEnglish · 7 days ago
message-square
22
link
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
alert-triangle
You must log in or # to comment.
  • CodingCarpenter@lemmy.ml
    link
    fedilink
    arrow-up
    48
    arrow-down
    2
    ·
    7 days ago

    That third one is also sad

    • very_well_lost@lemmy.world
      link
      fedilink
      English
      arrow-up
      25
      arrow-down
      1
      ·
      7 days ago

      https://xkcd.com/1171/

      • Billegh@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        7 days ago

        Must be bad at regular expressions. I generally get far more than one extra problem when using them.

        • Axolotl@feddit.it
          link
          fedilink
          arrow-up
          4
          ·
          7 days ago

          No, you see, the RG was to solve the problems

          • Billegh@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            5 days ago

            Solve the problem of not having enough problems? 🤔

    • 18107@aussie.zone
      link
      fedilink
      English
      arrow-up
      21
      ·
      7 days ago

      The past tense of regex is regrets.

  • BiscuityCat@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    7 days ago

    I never understood why are people scared of regular expressions. I love them and they can be quite usefull.

    Here is an example of one regex I wrote recently - it is used in replace:

    (?:^-\[[^[]+\]$| ?\[.+?\] ?)
    
    • Axolotl@feddit.it
      link
      fedilink
      arrow-up
      6
      ·
      6 days ago

      Must be irony

    • heartSagan5@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      5 days ago

      I could use a use case. RegEx are pretty “what does it mean” without what it’s targeted on.

      • BiscuityCat@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        5 days ago

        I have mentioned it in the comments below, but to explain it simply, I just wanted to remove all the bracketed text + a dash if there is no other text.

    • Funkt4st1c@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 days ago

      I started using regex because i need to rename a lot of my pirated media from “this_episode_uploaded_byXxXSuperEl33tSqwaaadXxX_MLP_s04_Episode7_bats.mkv”

      and linux deals with it very nicely. Much better than manual, anyways

  • aMockTie@piefed.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    6 days ago

    Why waste time doing any matching if wantarray == false? Just do:

    if(!wantarray) { return 1; }

    Before any matching happens, or if you only want one return statement set the value of a variable in if(!wantarray)/elsif(regex) and return that variable at the end.

    • Funkt4st1c@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 days ago

      Im predicting AI. Alternatively random screenshot from Google, which is probably AI.

  • raspberriesareyummy@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    5 days ago

    Top notch shitpost. Extra credit for perl!

  • SaharaMaleikuhm@feddit.org
    link
    fedilink
    arrow-up
    8
    ·
    7 days ago

    What the hell kind of disgusting language is that? I need to know so I can avoid it at all costs.

    • cannedtuna@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      10
      ·
      6 days ago

      The post is written in English 😔

    • jaybone@lemmy.zip
      link
      fedilink
      English
      arrow-up
      11
      ·
      7 days ago

      Not sure if joking, but that looks like Perl.

      I haven’t used it in like 20 years. There is a way to write it so that it’s not insane. You can write it kind of like C. But no one does that. So you end up looking at this crap.

      It’s been referred to as a “write-only” language, as it’s not readable.

      • raspberriesareyummy@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        5 days ago

        I know the reference from my perl days but I beg to differ. I wrote well-structured perl code with plenty of comments. I like to believe those projects of mine could be useful to someone else.

    • ILikeBoobies@lemmy.ca
      link
      fedilink
      arrow-up
      2
      ·
      6 days ago

      https://en.wikipedia.org/wiki/Regular_expression

      You can use it in any language.

  • CkrnkFrnchMn@lemmy.ca
    link
    fedilink
    arrow-up
    2
    ·
    6 days ago

    Practice safe hex as they say…

  • dukatos@lemmy.zip
    link
    fedilink
    arrow-up
    2
    ·
    6 days ago

    fucking perl! Loved it…

  • grandel@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    7 days ago

    Panting can also be a sign of stress with dogs

memes@lemmy.world

memes@lemmy.world

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: !memes@lemmy.world

Community rules

1. Be civil

No trolling, bigotry or other insulting / annoying behaviour

2. No politics

This is non-politics community. For political memes please go to !politicalmemes@lemmy.world

3. No recent reposts

Check for reposts when posting a meme, you can only repost after 1 month

4. No bots

No bots without the express approval of the mods or the admins

5. No Spam/Ads/AI Slop

No advertisements or spam. This is an instance rule and the only way to live. We also consider AI slop to be spam in this community and is subject to removal.

A collection of some classic Lemmy memes for your enjoyment

Sister communities

  • !tenforward@lemmy.world : Star Trek memes, chat and shitposts
  • !lemmyshitpost@lemmy.world : Lemmy Shitposts, anything and everything goes.
  • !linuxmemes@lemmy.world : Linux themed memes
  • !comicstrips@lemmy.world : for those who love comic stories.
Visibility: Public
globe

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

  • 1.56K users / day
  • 5.6K users / week
  • 10.1K users / month
  • 19.7K users / 6 months
  • 1 local subscriber
  • 22.8K subscribers
  • 3.37K Posts
  • 50.3K Comments
  • Modlog
  • mods:
  • Tenthrow@lemmy.world
  • The Picard Maneuver@lemmy.world
  • BE: 0.19.17
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org