logoalt Hacker News

SkiFire1301/16/20262 repliesview on HN

Sometimes I wish regexes were full matches by default and required prefixing and postfixing with `.*` to get the current behaviour


Replies

chuckadams01/16/2026

Java's Pattern.match() method works that way. Python has two separate methods: re.match auto-anchors, re.search does not.

ruined01/16/2026

a match isn't boolean, it's substring. the original (and more common) use-cases would become excessively verbose