• Oneironaut21@ani.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 days ago

    On average I’ve probably had to work with them or write one from scratch only a handful of times per year over my career. Not often enough to be an expert or anything but I’m not so afraid of them as I used to be.

  • lud@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    A few hours ago.

    I just wanted to make a list of AD group names into a powershell array.

      • bitcrafter@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        3 days ago

        Sure, but if you are not regularly expressing code that has the potential of summoning elder gods that will swallow your soul into a dimension of ceaseless screaming then are you really living?

  • NostraDavid@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    Yesterday, when I had a file with a list of JSON objects, and I wanted to move the date field at the end to the beginning, so I used regex find and replace to move it. Something like \{(.*?), ("date": ".*?") in Search, and then {$2, $1 in replace (or something close to it).

    Yes, I refactor code and data using regex. I can’t be arsed to learn AWK (even though I should).

  • towerful@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    Interesting to see a lot of these responses (so far) are workflow related instead of being used in production.

    • lad@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 days ago

      Probably, because in production there are really few things that are best done with regex. Most use I had for regex in production is filling in data from user-provided files with specifically crafted names, and even there there was some guesswork because of errors in naming, and the same thing may have been achieved without regex by splitting and/or iterating

  • livingcoder@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    3 days ago

    Yesterday doing a search using vim for a class that shared a lot of characters at the front with many other classes: /Bas.*Some I could have done a more precise search with better regex, but this was quick, easy, and worked.

  • Kissaki@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    3 days ago

    Earlier this week for a character range.

    /edit: Now I remember. For setting up a new entry in Jenkins CI build failure analysis - identifying the build failure cause in the log.