expr how to match 

>How can I use expr to pick out the filename (quoted in "'s) in the
>following line (should be one line).
>
>03-Sep.15:47   tongsun    checkout version "/clearlib/.../component.options" from /main/7 (reserved)
>
>I used
>  xargs -i expr {} : '"\(.*\)"'
>But it doesn't work.

expr expressions are implicitly anchored on both ends, so you need to make that:

xargs -i expr {} : '.*"\(.*\)".*'
>Similar things, I want to use expr to pick out the email address from
>the following addresses. And I didn't make it working...
>
>Some other names <name2@...>
expr "$line" : '.*<\([^>]*\).*'

Ken Pizzini

expr how to match 

Why do you need to use expr? Try:

<whatever_you_did>|cut -d'"' -f2

Claus.

documented on: 1999.09.24 Fri 17:56:39