86thumbs
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
NateNate60@lemmy.world to Programmer Humor@lemmy.ml ·
edit-2
1 年前

Oh boy what a beautiful regex. I'm sure it does something logical and easy to understand.

lemmy.world

message-square
81
fedilink
337

Oh boy what a beautiful regex. I'm sure it does something logical and easy to understand.

lemmy.world

NateNate60@lemmy.world to Programmer Humor@lemmy.ml ·
edit-2
1 年前
message-square
81
fedilink

^.?$|^(..+?)\1+$

<answer>

Matches strings of any character repeated a non-prime number of times

https://www.youtube.com/watch?v=5vbk0TwkokM

  • Morphit @feddit.uk
    link
    fedilink
    arrow-up
    4
    ·
    1 年前

    “abbabba”

    “abbabba” doesn’t match the original regex but “abbaabba” does

    • fubo@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      1 年前

      Good catch! Typo. Fixed.

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

remote_follow_modal_title

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: !programmerhumor@lemmy.ml

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.
community_visibility: public
globe

public_blurb

  • 119 users / day
  • 834 users / week
  • 2.14K users / month
  • 7.83K users / 6 months
  • number_of_local_subscribers
  • 38.7K subscribers
  • 1.87K Posts
  • 39.2K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • UI: unknown version
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org