338
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 31 Oct 2024
338 points (98.0% liked)
Programmer Humor
32591 readers
968 users here now
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.
founded 5 years ago
MODERATORS
Is there a reason to use
(..+?)
instead of(.+)
?Yes, the first one matches only 2 more characters while the second matches 1 or more. Also the +? is a lazy quantifier so it will consume as little as possible.
Ah, didn't know +? was lazy, thanks
I thought, the +? was going to be a syntax error. ๐
I was like, why specify "one or more" and then make it optional? Isn't that just .*?