Tip - how to output the matched pattern with sed

常常需要用到,却总容易忘记,这里记一下:

$ echo "this is just a test" | sed -n 's/.*<font color=j.st" />.*/\1/p'
just

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha