I always get a headache when i try to figure out regex.
I have the following string examples:
3;#i_0_.f_membership_john.smith@domain.com_LThumb.jpg
2;#i_0_.f_membership_jane.doe@domain.com_LThumb.jpg
I need to get the john.smith@domain.com piece from the string. The end of the string will always be _LThumb.xxx and the prefix should be always xxx_membership_.
If someone can come up with some C# regex to help me with this i would be very grateful
\w+?_membership_(\S*?)_LThumb.jpgThat includes the “should be there” prefix of
membershipat the front to make sure we pull only what we need out of our string.The e-mail will be in group 1 of the match.
You can play with the regex at Regexr.