how do I get good at regular expressions?

how do I get good at regular expressions?

  1. 2 weeks ago
    Anonymous

    Get kodi and batch rename your anime library to work with it.

    • 2 weeks ago
      Anonymous

      Use Emacs Wdired Mode.

      Done.

  2. 2 weeks ago
    Anonymous

    you don't
    indians write them for free on stackoverflow

  3. 2 weeks ago
    Anonymous

    Start with grep.

  4. 2 weeks ago
    Anonymous

    Commodore 64s are such trash. BBC Micro was better.

    • 2 weeks ago
      Anonymous

      Kek nice troll

      • 2 weeks ago
        Anonymous

        now compare BBC versions of Elite versus C64. then start crying.

  5. 2 weeks ago
    Anonymous

    chat gpt 4 is still out you know

  6. 2 weeks ago
    Anonymous

    Old xoomer proverb
    >write regex to solve problem, now have two problem

  7. 2 weeks ago
    Anonymous

    Don't bother.

    echo "[email protected]" | tr '@' 'n' > file
    sed -n '2p' file | sed s'@test2@hello@' > file2
    cat file2 | tr 'n' '@' > file

    Regexes rely on the idea of finding information which is all on the one line. If you can figure out how to insert carriage returns at regular intervals, finding and extracting what you need becomes much easier, than just using a regex.

    People will criticise me here because I'm making the computer perform multiple steps, whereas a regex looks like it's performing just one; but in reality with a regex, the user is performing the multiple steps inside their own head first, in order to design it. This way is easier.

  8. 2 weeks ago
    Anonymous

    Practice every single day. Or be like me and get a pretty good grip on the basics for one personal project. Then a few months later you find a problem that would be elegantly solved with regex. But decide to use a bunch of if/then/else statements because you forgot everything and are too lazy to go back to the previous project to see what the heck you did.

  9. 2 weeks ago
    中出し

    Practice with powershell on windows or perl on linux.

    Dont use grep or sed, both of those are gay as fuck and have gimped regex parsing unless you call them with extended support arg (-E), and even then they support barely any features.

    perl is the god of regex, and powershell implements PCRE, so it's great for practicing if you're on windows.

  10. 2 weeks ago
    Anonymous

    Practice

  11. 2 weeks ago
    Anonymous

    now I want to go experience q-link as it originally was 🙁

    ?t=72

  12. 2 weeks ago
    Anonymous

    Practice makes perfect, it's really the only solution.
    It healps to search for real world problems and solve them as exercises.

  13. 2 weeks ago
    Anonymous

    If you want to get good, you need to learn them using perl. You just need to know how to write basic hello world first and then start going through the regular expression tutorial https://perldoc.perl.org/perlretut

    • 2 weeks ago
      Anonymous

      isn't it raku now?

  14. 2 weeks ago
    Anonymous

    use a code editor where find and replace are done with regex by default. like vim

  15. 2 weeks ago
    Anonymous

    C64 - nice!

  16. 2 weeks ago
    Anonymous

    Get a job writing parsers for a SOC that ingests logs of all the shittest tier network devices known to man.

  17. 2 weeks ago
    Anonymous

    write a nano syntax highlighting file for some programming language

  18. 2 weeks ago
    Anonymous

    go to regexr.com and practice, it's pretty great.
    one thing to keep in mind is that a regex pattern is like its own shorthand language

    slashes / / contain the pattern
    the flag / /g means find the pattern as many times at it appears in the string
    the pattern itself can be a plain word, or symbols or ranges, for example
    /fag/ will find the first instance of the sequence of letters 'fag'
    /fag/g will find all the instances of the sequence of letters 'fag'

    another thing to keep in mind is that a regex pattern on it's own does nothing, it's meant to be used with a function and most of it's use cases are with a string method.
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String

    LULZ boards will run middleware on posts using regexes, like if they wanted to censor the word fag and replace it with pony they would do something like
    preparedPost = submittedPost.replace(/fag/ig, "pony") the i flag means case insensitive.

  19. 2 weeks ago
    Anonymous

    Who cares? I had to learn regular expressions for a logic course, but in day-to-day tasks like programming, you can easily ask ChatGPT or search Stack Overflow.

Your email address will not be published. Required fields are marked *