regex part1 positive and negative look behind

Negative look behind:

(?<!spam)@.*

# select all the email where userpart in email doesNOT contain the word spam

Positive look behind:

(?<=spam)@[^;,]+  # this matches below domain part only eg. "zohomail.com"

input:-

spam@zohomail.com; spam@google.com; spam@hotmail.com; ram@klsd.com
spam@gmail.com; spam@jira-ya.com,

Non capturing group
(?RegexHere)

No comments:

Post a Comment