• katy ✨@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    2
    ·
    6 months 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

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

    Nothing to see here folks

  • stewie410@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    6 months 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
      0
      arrow-down
      1
      ·
      6 months 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.

  • CCF_100@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    5 months ago

    Hey ChatGPT, here’s an example string, how would you get this string out of it with <insert regex implementation>?