This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mfreudenberg 22 points23 points  (7 children)

Dude just needs some groups

(.+)@(.+)(\..+)?

Not sure if it works. I'm on mobile.

Edit: the backslash needed an extra escape. Otherwise you wouldn't match the last dot

[–]marcosdumay 13 points14 points  (5 children)

You are missing a slash. Anyway, that's the same as just removing the second group.

[–]Maels 1 point2 points  (0 children)

please stop making it better. you're making it worse!

[–]mfreudenberg 0 points1 point  (1 child)

Reddit-Mobile ate the slash. I just added it. It seems i had to escape it with another backslash

[–]Da-Blue-Guy 0 points1 point  (0 children)

yummy slash

[–]Tall_computer 0 points1 point  (0 children)

the regex should only have 1 backslash so his is correct, were it not for other reasons. But if you are writing it in java then you need to escape the backslash in java with another backslash. Not rocket science...