Home > Software engineering >  regular expression in python to extract words that contain @ but not dot
regular expression in python to extract words that contain @ but not dot

Time:02-10

I am using Python to extract words from a text. I want to extract word that contain@ but not dot.

regular expression should match following: @bob, cat@bob regular expression should not match: [email protected].

I tried following: (?:\w )?@\w (?!.) - but it extracts @bob, cat@bob and xyz@bo

CodePudding user response:

  •  Tags:  
  • Related