News for hackers. Stuff that matters.
Re:Regex character "$" doesn't mean "end-of-string" by layer8 on Wednesday March 20, 2024 @09:07AM (#39765886)
I generally agree, but the two consecutive dots (or leading/trailing dots) are an example that would very likely be a typo and that you wouldn’t particularly want to send. Similar for unbalanced quotes, angle brackets, and other grammar elements.
Re:Regex character "$" doesn't mean "end-of-string" by dumbo-octopus on Wednesday March 20, 2024 @01:45PM (#39769840)
I wonder whether simply (regex) replacing a sequence of .'s with a single one as part of a post-processing step would be effective.
Re:Regex character "$" doesn't mean "end-of-string" by layer8 on Wednesday March 20, 2024 @02:11PM (#39770116)
That would be bad form, IMO. The user may have typed [email protected] by mistake instead of [email protected], and now you’ll be sending their email to [email protected]. Similar for leading or trailing dots. You can’t just decide what a user probably meant, when they type in something invalid.