programming.dev
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 1 year ago

How to regex

lemmy.ml

message-square
14
link
fedilink
235

How to regex

lemmy.ml

☆ Yσɠƚԋσʂ ☆@lemmy.ml to Programmer Humor@lemmy.mlEnglish · 1 year ago
message-square
14
link
fedilink
alert-triangle
You must log in or register to comment.
  • katy ✨@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    14
    ·
    1 year ago

    open up google

    search for exactly the result you want

    find an answer on stack exchange that isn’t just “nevermind figured it out”

    copy and paste into your code

  • Norgur@fedia.io
    link
    fedilink
    arrow-up
    14
    arrow-down
    1
    ·
    edit-2
    1 year ago

    Coworker: “Hey, I got this really cool new tool that will solve this data filtering problem you had” Me:: “Cool! Let me check out the filters!” Coworker. “They are awesome and work by RegEx!” Me: “Nope, not interested.” Coworker: “But… it fits your needs exactly” Me: “I. said. NOT. INTERESTED!”

  • tetris11@lemmy.ml
    link
    fedilink
    arrow-up
    10
    ·
    1 year ago
    while :; do curl -X POST -d '{"text": "Removed by mod" }' https://lemmy.ml/post/13463433; done
    

    Nothing to see here folks

  • ALostInquirer@lemm.ee
    link
    fedilink
    arrow-up
    6
    ·
    1 year ago

    Is there a less arcane way to perform searches similarly to regex?

    • Digital Mark@lemmy.ml
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 year ago

      There’s other, more verbose, regular expression languages, for instance SRFI-115 for Scheme. But the hard part isn’t the syntax, but actually thinking about patterns, so it won’t help you any.

      Just get the O’Reilly bat book and learn. So what if it overwrites 10% of your brain and you can’t remember your mother’s face, you’ll have a useful skill.

    • MonkderZweite@feddit.ch
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Learn the regex rules.

  • TechCodex
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 year ago

    Step 3: Name your cat ‘Regex’

  • Tenkard@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Wrote a regex today and realized it looked like two people waving a hand ;D

    • dukk
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Donut regex when???

  • stewie410
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    I don’t know all of the regex rules (look ahead/behind, etc); but it’s honestly not that bad. If you can learn the syntax for a programming language, you can learn the basics of regex…

    • ☆ Yσɠƚԋσʂ ☆@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      3
      ·
      1 year ago

      Sure, learning basics of regex is not that hard, but complex regex expressions can easily become impenetrable. I actually like the verbal expressions idea where you write out the regex using a long form and that gets compiled into the actual regex, e.g:

      const tester = VerEx()
          .startOfLine()
          .then('http')
          .maybe('s')
          .then('://')
          .maybe('www.')
          .anythingBut(' ')
          .endOfLine();
      

      That seems like the best of both world approach to me.

      • stewie410
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        My brief experience with LINQ has also taught me to prefer this type of thing as well; though I still use regex on a daily basis most of the time, given my environment.

  • ThuleanPerspective@eviltoast.orgBanned
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    Removed by mod

  • ThuleanPerspective@eviltoast.orgBanned
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    Removed by mod

    • ElTacoEsMiPastor@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      that toast must really be evil…

  • ThuleanPerspective@eviltoast.orgBanned
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Removed by mod

  • ThuleanPerspective@eviltoast.orgBanned
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Removed by mod

  • ThuleanPerspective@eviltoast.orgBanned
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Removed by mod

  • ThuleanPerspective@eviltoast.orgBanned
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Removed by mod

  • ThuleanPerspective@eviltoast.orgBanned
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Removed by mod

  • ThuleanPerspective@eviltoast.orgBanned
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Removed by mod

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: [email protected]

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.

  • 204 users / day
  • 717 users / week
  • 1.69K users / month
  • 9.93K users / 6 months
  • 725 local subscribers
  • 35.6K subscribers
  • 1.74K Posts
  • 38.5K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org