Hi all!

I started to write a really small shell script, but i'm really stucked with a key part. I have a variable (multi line) and i would like to match only an url in it with regex. If i would use php, i would use preg_match. I read a lot, and found grep, which is not good for me (as i don't need the whole line), so i guess the only one working would be awk (correct me if i am wrong)

So please help me to find a regex pattern matcher in shell.


Code: 
hell=<<<EOT
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
<script type="text/javascript" src="clientscript/hsjs.php"></script>
<link rel="stylesheet" type="text/css" href="clientscript/hscss.php" />
<script type="text/javascript">hs.graphicsDir="images/highslide/";
if(hs.registerOverlay){
	hs.registerOverlay({
		thumbnailId: 'thumb2',
		html: '<div class="closebutton"	onclick="return hs.close(this)" title="Close"></div>',
		position: 'top right',
		fade: 2
	});
}
EOT
Please grab the src=" part with shell regex into a variable (not a text file)

Thank you!
mahjong Reviewed by mahjong on . Regex in shell Hi all! I started to write a really small shell script, but i'm really stucked with a key part. I have a variable (multi line) and i would like to match only an url in it with regex. If i would use php, i would use preg_match. I read a lot, and found grep, which is not good for me (as i don't need the whole line), so i guess the only one working would be awk (correct me if i am wrong) So please help me to find a regex pattern matcher in shell. hell=<<<EOT <script Rating: 5