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 *

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