Author Posts

March 30, 2017 at 2:29 pm


I'm fighting to make a regex to find any text after a space and before an @ and any text before that until it reaches a whitespace again...

$myString = @"
dys dkan jdna hhaksda d asda
dsad ada sdd asd fdfsd 

Using this:

(Select-String -InputObject $myString -Pattern '\w+@\w+\.\w+.\w+' -AllMatches).Matches | ft * -AutoSize

I only get the without the manolo...
I want to find any text that has a @ in the middle... (Ex.:,, etc)

March 30, 2017 at 2:52 pm

You could use a pattern like that


and it fits with the examples you posted but a little more sofisticated would be this I think



March 30, 2017 at 4:58 pm

Olaf Soyk,

You're the man! Thanks a lot!