Q:

Get the text inside "<" and ">" with grep in batch

I'm trying to grep a word in a file.txt inside "<" and ">" for two days but impossible to get it. For example, i've something like that in a file.txt :
30993250 (<someone@mail.com> 2014-09-22 12:41:56 +0200 365)
It come from a git blame -L 365,+1 path\to\file.cpp-e and i want to only recover the email inside. I'm trying this following code :
grep -oP '(?<=\<)\w+(?= \>)' ..\log\file.txt > ..\log\result.txt
and
grep -Po '(?<=\().*(?=\))' ..\log\file.txt > ..\log\result.txt
But it doesn't works and says the syntax of file is incorrect or the specified path was not found. I don't understand, I've tried lots of combinations but nothings works...
I want to say i'm using batch under Windows. Is there somebody who can help me please ?
EDIT : I found a solution where i use the ASCII table like that :
grep -oP '["\074].*["\076]' ..\log\file.txt > ..\log\result.txt
But display the "<>" characters like this :
<someone@mail.com>
How i can remove that ?
Thanks

A:

grep will find and show lines, it will not remove anything from a line.  
But in your case you can read the result and remove the <> characters.
grep -oP '["\074].*["\076]' ..\log\file.txt > ..\log\result.txt
setlocal EnableDelayedExpansion
set /p line=   < ..\log\result.txt
set "line=!line:<=!"
set "line=!line:>=!"
echo !line!

