Hover Text:

Wait, forgot to escape a space. Wheeeeee[taptaptap]eeeeee!

Transcript

[in a yellow box:]
Whenever I learn a new skill I concoct elaborate fantasy scenarios where it lets me save the day.

Megan: Oh no! The killer must have followed her on vacation!
[Megan points to computer.]
Megan: But to find them we’d have to search through 200 MB of emails looking for something formatted like an address!
Cueball: It’s hopeless!

Off-panel voice: Everybody stand back.

Off-panel voice: I know regular expressions.

[A man swings in on a rope, toward the computer.]

tap tap
The word PERL! appears in a bubble.

[The man swings away, and the other characters cheer.]

  • @[email protected]
    link
    fedilink
    4
    edit-2
    10 months ago

    I’ve never bothered to learn regex because I can do this sort of stuff easily in Python. For any non-trivial job it’s better to have things like error handling, statistics, logs and *gasp* readability.

    • @DoYouNot
      link
      1310 months ago

      Are you not using regex in Python to do that?

        • @[email protected]
          link
          fedilink
          1410 months ago

          Regex is fast and useful though. It’s a tool in your toolbox that make certain situations extremely easy as the comic depicts.

            • @DoYouNot
              link
              99 months ago

              I guess I’m just not sure what your doing in Python that is equivalent in some way to regex without using the re library. Like, do you mean you’re using looped ifs and raw strings to do something similar?

        • @pivot_root
          link
          3
          edit-2
          9 months ago

          Learning basic regex takes less than a day. Learning extended regex takes a day or two.

          If you’re often writing Python scripts to scan strings and match patterns, I can almost guarantee you’re actually wasting more of your time avoiding having to use regex.

          In fact, if you’re working with large datasets, you’re wasting even more time waiting for your scripts to finish. Python’s regular expression engine is written in C, which is considerably faster than plain Python.