I have a file in which each line is like this372^^2015-09-03 06:59:44.475^NEW^N/A^^0^105592^https://example-url.com^example-domain < MEN'S ULTRA < UltraSeriesViewAll(18)^New^MERCHANT_PROVIDEDI want to extract the urls in the file -- https://example-url.comI tried these regex using sed command -- sed -n '/^http/,/^/p' But it didn't solve my problem. Pardon me for this problem as I am beginner in sed and regex. 
extract url between 2 strings in a file
sed;awk;grep;regular expression
You could use thissed -n 's!^.*\^\(http[^^]*\)^.*!\1!p'The potential gotcha for a beginner to REs is that ^ is an indicator for start of line, so you have to ensure you escape it \^ if you want a literal up arrow at the start of your RE.The RE pattern match can be explained as follows^.*\^ -- Match from start of line until we see the last possible up-arrow double-quote ^ that satisfies the rest of the pattern\( -- Start a substitution block that can be substituted as \1http[^^]* -- Match http followed by as many characters that are not ^ as possible\) -- End the substitution block^.* -- Match double-quote and up-arrow ^, then as much as possible (until end of line)This entire match is replaced by \1, which is the pattern block starting http