Coldfusion 8 Error: Invalid image format or slow performance - image-processing

Trying to troubleshoot someone else's not-so-great code. Any ideas would be greatly appreciated. It seems to bomb out at the <cfif> that brings in the image:
<cfif LEN(qryCampers.std_image_filename[iRow + iCol]) GT 0>
If I comment out that if (and only keep the section related to the "no_image.gif" out of the cfif statement) we're good. The document appears.
CF Server 8, SQL Server 2000, Images are relatively small in size (all under 30kb, no more than 300px in width), this code works some of the time and when it does, it takes FOREVER to load the PDF. This particular query (only 12 records) is causing the error.
The Error:
Invalid image format
The error occurred in D:\apps\Websites\Example\app\reports\dsp_camper_cards_preview.cfm: line 51
49 : <td width="40%" align="center" valign="middle">
50 : <cfif LEN(qryCampers.std_image_filename[iRow + iCol]) GT 0>
51 : <cfimage source="../photos/#qryCampers.std_image_filename[iRow + iCol]#" action="read" name="cardImage">
52 : <cfif cardImage.height GT cardImage.width>
53 : <img src="../photos/#qryCampers.std_image_filename[iRow + iCol]#" height="150">
The cfdocument Code:
<cfdocument filename="#fileName#" format="PDF" pagetype="letter"
margintop=".175" marginbottom=".125" marginright=".125" marginleft=".125"
orientation="portrait" unit="in" encryption="none" fontembed="Yes" backgroundvisible="No" overwrite="Yes">
<style type="text/css">
table, tr, td { font-size: 9px; font-family:Arial; }
</style>
<table width="100%" border="0" cellpadding="2" cellspacing="2" align="center" bordercolor="000000">
<cfloop from="1" to="#Ceiling(qryCampers.recordcount/2)#" index="iRow">
<tr valign="top">
<cfloop from="#iRow - 1#" to="#iRow#" index="iCol">
<cfif LEN(qryCampers.student_id[iRow + iCol]) GT 0>
<cfquery name="qryMedInfo" datasource="#session.datasource#">
SELECT * FROM tbl_medical_info_form WHERE mif_std_id = #qryCampers.student_id[iRow + iCol]# AND mif_trip_year = '#DateFormat(Now(), '01/01/yyyy')#'
</cfquery>
<td width="50%">
<table width="100%" border="0" cellpadding="2" cellspacing="2" align="center">
<tr valign="top">
<td height="25%">
<table width="100%" border="0" cellpadding="2" cellspacing="2" align="center">
<tr valign="top">
<td width="40%" align="center" valign="middle">
<cfif LEN(qryCampers.std_image_filename[iRow + iCol]) GT 0>
<cfimage source="../photos/#qryCampers.std_image_filename[iRow + iCol]#" action="read" name="cardImage">
<cfif cardImage.height GT cardImage.width>
<img src="../photos/#qryCampers.std_image_filename[iRow + iCol]#" height="150">
<cfelseif cardImage.height LTE cardImage.width>
<img src="../photos/#qryCampers.std_image_filename[iRow + iCol]#" height="150">
</cfif>
<cfelse>
<img src="../images/no_image.gif" alt="" width="" height="150" border="0">
</cfif>
</td>
<td width="60%">
<cfif qryMedInfo.mif_c_alleriges EQ "Yes" OR LEN(qryMedInfo.mif_severe_allerigies) GT 0>
<font color="FF0000" style="font-size:16px;">ALLERGIES</font><br>
</cfif>
<cfif qryMedInfo.mif_r_alcohol EQ "Yes">
<font color="FF0000" style="font-size:16px;">ALLOWED TO DRINK</font><br>
<cfelse>
<font color="FF0000" style="font-size:16px;">NOT ALLOWED TO DRINK</font><br>
</cfif>
<u>Parent Note</u> : <cfif qryMedInfo.mif_c_alleriges EQ "Yes">#qryMedInfo.mif_history_comments#</cfif><br>
<u><font color="FF0000">SEVERE ALLERGIES</font></u> : #qryMedInfo.mif_severe_allerigies#<br>
<br>
<u>Conditions</u> : #qryMedInfo.mif_med_conditions_1#<br>
<cfif Len(qryMedInfo.mif_med_conditions_2) GT 0>#qryMedInfo.mif_med_conditions_2#<br></cfif>
<u>Medications</u> : <font color="FF0000">#TRIM(qryMedInfo.mif_med_taken_1)#</font><br>#TRIM(qryMedInfo.mif_med_taken_2)#<br>
<font color="FF0000"><u>CANNOT TAKE</u> : </font>
<cfif qryMedInfo.mif_r_aspirin EQ "No"> Aspirin,</cfif>
<cfif qryMedInfo.mif_r_pepto EQ "No"> Pepto Bismol,</cfif>
<cfif qryMedInfo.mif_r_non_aspirin EQ "No"> Non-Apsirin (Acetaminophen/Tylenol),</cfif>
<cfif qryMedInfo.mif_r_maalox EQ "No"> Maalox,</cfif>
<cfif qryMedInfo.mif_r_nsaid EQ "No"> NSAID (Ibuprofen/Advil, Motrin or Naproxensodium/Aleve),</cfif>
<cfif qryMedInfo.mif_r_immodium EQ "No"> Immodium,</cfif>
<cfif qryMedInfo.mif_r_benadryl EQ "No"> Benadryl,</cfif>
<cfif qryMedInfo.mif_r_simethicone EQ "No"> Simethicone (GasX),</cfif>
<cfif qryMedInfo.mif_r_sudafed EQ "No"> Pseudoephedrine/Sudafed,</cfif>
<cfif qryMedInfo.mif_r_tagamet EQ "No"> Tagamet or similar,</cfif>
<cfif qryMedInfo.mif_r_cough EQ "No"> Cough Medicine,</cfif>
<cfif qryMedInfo.mif_r_bandages EQ "No"> Bendages,</cfif>
<cfif qryMedInfo.mif_r_throat EQ "No"> Throat Lozenges,</cfif>
<cfif qryMedInfo.mif_r_antibiotic EQ "No"> Antibiotic Ointment,</cfif>
<cfif qryMedInfo.mif_r_ex_anesthetic EQ "No">External Anesthetic (Calamine or the like),</cfif>
<cfif qryMedInfo.mif_r_cortisone EQ "No"> Topical Cortisone Cream,</cfif>
<cfif qryMedInfo.mif_r_tylenol_pm EQ "No"> Tylenol PM</cfif>
<br>
</td>
</tr>
<tr>
<td colspan="2">
<font style="font-size:16px;font-weight:bold;color:0000ff;">
#qryCampers.std_first_name[iRow + iCol]# #qryCampers.std_last_name[iRow + iCol]#
</font><br>
<br>
<u>Emergency Contact</u> : #qryMedInfo.mif_emerg_name# <cf_phoneoutput startstring="#GetNumbers(qryMedInfo.mif_emerg_phone)#"><br>
<br>
<u>Father/Gaurdian</u> : #qryCampers.ftr_first_name[iRow + iCol]# #qryCampers.ftr_last_name[iRow + iCol]#
<u>(H)</u> <cf_phoneoutput startstring="#GetNumbers(qryCampers.ftr_main_phone[iRow + iCol])#"> or <u>(C)</u> <cf_phoneoutput startstring="#GetNumbers(qryCampers.ftr_cell_phone[iRow + iCol])#"><br>
<u>Mother/Gaurdian</u> : #qryCampers.mtr_first_name[iRow + iCol]# #qryCampers.mtr_last_name[iRow + iCol]#
<u>(H)</u> <cf_phoneoutput startstring="#GetNumbers(qryCampers.mtr_main_phone[iRow + iCol])#"> or <u>(C)</u> <cf_phoneoutput startstring="#GetNumbers(qryCampers.mtr_cell_phone[iRow + iCol])#"><br>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<cfelse>
<td width="50%"> </td>
</cfif>
</cfloop>
</tr>
<cfif iRow MOD 4 IS 0>
<tr>
<td> </td>
</tr>
</cfif>
</cfloop>
</table>
</cfdocument>

As far as your invalid image error, we had a similar issue with invalid formats and slow performance. Our solution was to convert the image to a png then back to jpg using cfimage. We did it as the image was uploaded but you could do the same thing in your situation.
<cfimage source="#expandPath('\images\temp')#\#cffile.serverFile#" action="convert" destination="#expandPath('\images\temp')#\#cffile.serverFileName#.png" overwrite="yes">
<cfimage source="#expandPath('\images\temp')#\#cffile.serverFileName#.png" action="convert" destination="#expandPath('\images\temp')#\#cffile.serverFileName#.jpg" overwrite="yes">

It sounds like the image found in this line <cfimage source="../photos/#qryCampers.std_image_filename[iRow + iCol]#" action="read" name="cardImage"> is not a valid image format. Are you sure what it is trying to read there is an image?

Have you tried using "isImage"?
<cfif trim(qryCampers.std_image_filename[iRow + iCol]) neq ''
AND isImage('../photos/#qryCampers.std_image_filename[iRow + iCol]#')>
I agree with #Leeish that the CFImage tag is getting something that it doesn't recognize as an image. I have had time when I've had a jpg that was marked as a jpg and I could view it in a browser but then I tried to pull it up in photoshop or something similar I found that there was a aheader problem in the jpg itself that was preventing cfimage or cfx_ImageCR (which I prefer).

Related

Extract text from a specific row in the table with Capybara

Friends for me to finish my test and I just need to extract the text of the tooltip from the specific line of the table. Thomas Walpole has helped me a lot. Now I can read the excel spreadsheet and I will validate with each line of the application.
****** I read excel and get the first line *************
Spreadsheet.client_encoding = 'UTF-8'
book = Spreadsheet.open('c:/temp/Pasta1.xls', "r")
sheet = book.worksheet 0
#sheet.each do |row|
pp hydrometer = sheet.row(1)
****** reading the specific row of the table *************
I just need to extract this text save in a variable and validate with the hydrometer variable that stores the row of my excel sheet
expect(page).to have_css('tr.tvRow:nth-child(2) .tvCell:nth-child(6) img[tooltip="Invisível"]')
see the code
<tr oncontextmenu="if(!this.cancelEvent) {sendEvent(0,event,this,true,0,'TVXWFMTGINSTATOCE','bdb','BtnDropDownRow#',1,'','','');return false;} delete this.cancelEvent;" onclick="if(notSelecting()) sendEvent(0,event,this,true,0,'TVXWFMTGINSTATOCE','bdb','Select#',1,'','','');" onmousedown="if(event.ctrlKey) this.cancelEvent=true;" class="tvRow tvRowEven tvRoll tvRowSelected" style="cursor:pointer;">
<td valign="center" align="left" class="tvCell">XWFMSLETMATRICOLA_E</td>
<td valign="center" align="left" class="tvCell"> Nº Hidrômetro</td>
<td align="left" class="tvCell" valign="center" nowrap=""></td>
<td valign="center" align="left" class="tvCell"></td>
<td align="left" width="1" class="tvCell" valign="center" tooltip="[AIMPMATRICOLA]">
<button onclick="event.cancelBubble=true;sendEvent(0,event,this,searchImage(this),0,'','bdb','AUTOFILLBTN#',1,'','','','');" class="but butAct" tabindex="0" tooltip="Preenchimento automático ativado" type="BUTTON">
<div><img src="r/std/icons/checkboxselected64.png" class="icon" draggable="false" align="absmiddle"></div>
</button>
</td>
<td valign="center" align="center" class="tvCell"><img tooltip="Invisível" src="r/std/static/minus16.gif"></td>
<td align="center" width="30" style="line-height:1px;padding:0px;" class="tvCell" valign="center">
<div onclick="event.cancelBubble=true;sendEvent(0,event,this,searchImage(this),0,'','bdb','BtnDropDownRow#',1,'','','','');" class="but">
<div><img src="r/std/icons/menu64.png" class="icon" draggable="false" align="absmiddle"></div>
</div>
</td>
</tr>
<tr oncontextmenu="if(!this.cancelEvent) {sendEvent(0,event,this,true,0,'TVXWFMTGINSTATOCE','bdb','BtnDropDownRow#',2,'','','');return false;} delete this.cancelEvent;" onclick="if(notSelecting()) sendEvent(0,event,this,true,0,'TVXWFMTGINSTATOCE','bdb','Select#',2,'','','');" onmousedown="if(event.ctrlKey) this.cancelEvent=true;" class="tvRow tvRowOdd tvRoll" style="cursor:pointer;">
<td valign="center" align="left" class="tvCell">XWFMSLETLETTURA_E</td>
<td valign="center" align="left" class="tvCell"> Leitura</td>
<td align="left" class="tvCell" valign="center" nowrap=""></td>
<td valign="center" align="left" class="tvCell"></td>
<td align="left" width="1" class="tvCell" valign="center" tooltip=""></td>
<td valign="center" align="center" class="tvCell"><img tooltip="Invisível" src="r/std/static/minus16.gif"></td>
<td align="center" width="30" style="line-height:1px;padding:0px;" class="tvCell" valign="center">
<div onclick="event.cancelBubble=true;sendEvent(0,event,this,searchImage(this),0,'','bdb','BtnDropDownRow#',2,'','','','');" class="but">
<div><img src="r/std/icons/menu64.png" class="icon" draggable="false" align="absmiddle"></div>
</div>
</td>
</tr>
If hydrometer contains the text you're checking for just interpolate it in the CSS selector you're using
expect(page).to have_css("tr.tvRow:nth-child(2) .tvCell:nth-child(6) img[tooltip='#{hydrometer}']")
Since your going through a loop you'd probably also want to interpolate the row number but I don't know what variable you have that in
expect(page).to have_css("tr.tvRow:nth-child(#{row_number}) .tvCell:nth-child(6) img[tooltip='#{hydrometer}']")
If you really want to get the tooltip text for a specific row you would do
text = find("tr.tvRow:nth-child(2) .tvCell:nth-child(6) img[tooltip]")[:tooltip] # get the tooltip attribute value from the 2nd row
but doing that and then comparing it to some other string is bad practice and will lead to flaky tests. It is much better to do the have_css shown above

the divider line way too long on outlook

I have coded an email template and it works great overall but I have an issue with the length of the divider line:
The divider is way too long when I send a test mail to my outlook mail but have the right length on all other mail clients.
<table border="0" agrepeatingblock="active" role="presentation" cellpadding="0" width="100%" cellspacing="0" style="width: 100%;" agid="greenline-development_group_2_block_11">
<tr>
<td align="center" style="vertical-align:top;padding:Block::Margin_top|INTEGER|0px 0 Block::Margin_bottom|INTEGER|0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation" style="width:100%;background-color:Block::Block_container|COLOR|transparent;">
<tr>
<td align="center" style="vertical-align: top;">
<!--[if (gte mso 9)|(IE)]>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" style="width:100%;" role="presentation">
<tr>
<td align="center" valign="top" width="100%" style="width:100%; max-width:706px">
<![endif]-->
<table border="0" cellpadding="0" width="100%" cellspacing="0" style="width:100%;max-width:706px;Margin:0 auto;background-color:Block::Content_container|COLOR|transparent;" role="presentation">
<tr>
<td align="center" style="vertical-align:top;padding:${blockparam:Block::Padding_top|INTEGER|10}px 12px 0;" class="pt-10">
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation" style="width: 100%;">
<tr>
<td align="center" style="vertical-align: top; padding: 10px 12px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0" role="presentation" style="width: 100%;">
<tr>
<td
height="${blockparam:Block::Padding_bottom|INTEGER|10}"
style="border-top:${blockparam:Horizontal_rule::Size|INTEGER|1}px solid ${blockparam:Horizontal_rule::Color|COLOR|#47c16c};height:${ref:Block::Padding_bottom}px;font-size:${ref:Block::Padding_bottom}px;line-height:${ref:Block::Padding_bottom}px;"
class="h-sm-10"
></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
<![endif]-->
</td>
</tr>
</table>
</td>
</tr>
</table>

Not able to show committers list in Jenkins Jelly email template

We have recently migrated our jenkins to 1.6 version and I have findbug project set. While showing findbug results in email using below jelly template, "Find Bugs warnings info" section shows error message as "Find Bugs Publisher did not get invoked due to an error". But I do not see any error in console.
Also, "New Warnings" section is not showing up. It looks that fb variable is null and no results are showing up in email template.
Even the change sets section is not visible.
Is there any setting missing for findbug in Jenkins required to show up these results.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define">
<html>
<head>
<title>${project.name}</title>
<style>
body table, td, th, p, h1, h2 {
margin:0;
font:normal normal
90% Georgia, Serif;
background-color: #ffffff;
}
h1, h2 {
border-bottom:dotted 1px #999999;
padding:5px;
margin-top:10px;
margin-bottom:10px;
color: #000000;
font: normal bold 90%
Georgia,Serif;
background-color:#f0f0f0;
}
</style>
</head>
<body>
<div class="header">
<j:set var="spc" value="&nbsp;&nbsp;" />
<h1>
<j:choose>
<j:when test="${build.result=='SUCCESS'}">
<img src="${rooturl}static/e59dfe28/images/32x32/blue.gif" />
</j:when>
<j:when test="${build.result=='FAILURE'}">
<img src="${rooturl}static/e59dfe28/images/32x32/red.gif" />
</j:when>
<j:otherwise>
<img
src="${rooturl}static/e59dfe28/images/32x32/yellow.gif" />
</j:otherwise>
</j:choose>
BUILD ${build.result}
</h1>
<table>
<tr>
<td>Build URL</td>
<td>
${rooturl}${build.url}
</td>
</tr>
<tr>
<td>Project:</td>
<td>${project.name}</td>
</tr>
<tr>
<td>Date of build:</td>
<td>${it.timestampString}</td>
</tr>
<tr>
<td>Build duration:</td>
<td>${build.durationString}</td>
</tr>
<tr>
<td>Build cause:</td>
<td>
<j:forEach var="cause" items="${build.causes}">${cause.shortDescription}
</j:forEach>
</td>
</tr>
<tr>
<td>Build description:</td>
<td>${build.description}</td>
</tr>
<tr>
<td>Built on:</td>
<td>
<j:choose>
<j:when test="${build.builtOnStr!=''}">${build.builtOnStr}
</j:when>
<j:otherwise>master</j:otherwise>
</j:choose>
</td>
</tr>
</table>
</div>
<!-- Static Analysis -->
<j:set var="actions" value="${it.staticAnalysisActions}" />
<j:if test="${!actions.isEmpty()}">
<div class="content">
<h1>Static Analysis Results</h1>
<table>
<tr>
<th></th>
<th>Name</th>
<th>Result</th>
<th>Total</th>
<th>High</th>
<th>Normal</th>
<th>Low</th>
</tr>
<j:forEach var="action" items="${actions}">
<tr>
<td>
<img src="${rooturl}${action.smallImageName}" />
</td>
<td>
<a href="${rooturl}${build.url}/${action.urlName}">${action.displayName}
</a>
</td>
<td class="center">
<j:choose>
<j:when test="${action.result.pluginResult=='SUCCESS'}">
<img src="${rooturl}static/e59dfe28/images/16x16/blue.gif" />
</j:when>
<j:when test="${action.result.pluginResult=='FAILURE'}">
<img src="${rooturl}static/e59dfe28/images/16x16/red.gif" />
</j:when>
<j:otherwise>
<img src="${rooturl}static/e59dfe28/images/16x16/yellow.gif" />
</j:otherwise>
</j:choose>
</td>
<td class="center">${action.result.numberOfAnnotations}
</td>
<td class="center">${action.result.getNumberOfAnnotations('HIGH')}
</td>
<td class="center">${action.result.getNumberOfAnnotations('NORMAL')}
</td>
<td class="center">${action.result.getNumberOfAnnotations('LOW')}
</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
<!-- More Find bugs info-->
<j:set var="fb" value="${it.getAction('hudson.plugins.findbugs.FindBugsResultAction')}" />
<div class="content">
<h1>Find Bugs warnings info</h1>
<table width="100%">
<tr>
<th>Total</th>
<th>Fixed</th>
<th>New</th>
<th >Report</th>
</tr>
<tr>
<td class="center">${fb.result.numberOfWarnings}</td>
<td class="center">${fb.result.numberOfFixedWarnings}</td>
<td class="center">${fb.result.numberOfNewWarnings}</td>
<td class="center">View Report</td>
</tr>
</table>
</div>
<j:set var="newWarnings" value="${fb.result.newWarnings}" />
<j:if test="${newWarnings!=null}">
<div class="content">
<h1>New warnings</h1>
<table width="100%" class="newWarningsborder">
<tr>
<th width="20%" class="newWarningsborder">Name</th>
<th width="5%" class="newWarningsborder">Line</th>
<th width="*" class="newWarningsborder">Message</th>
</tr>
<j:forEach var="fileAnnotation" items="${newWarnings}" varStatus="loop">
<tr>
<td width="20%" class="newWarningsborder">${fileAnnotation.shortFileName}</td>
<td width="5%" class="newWarningsborder">${fileAnnotation.primaryLineNumber}</td>
<td width="*" class="newWarningsborder">${fileAnnotation.message}</td>
</tr>
</j:forEach>
</table>
</div>
</j:if>
<!-- CHANGE SET -->
<div class="content">
<j:set var="changeSet" value="${build.changeSet}" />
<j:if test="${changeSet!=null}">
<j:set var="hadChanges" value="false" />
<a href="${rooturl}${build.url}/changes">
<h1>Changes</h1>
</a>
<j:forEach var="cs" items="${changeSet.logs}" varStatus="loop">
<j:set var="hadChanges" value="true" />
<h2>${cs.msgAnnotated}</h2>
<p>
by
<em>${cs.author}</em>
</p>
<table>
<j:forEach var="p" items="${cs.affectedFiles}">
<tr>
<td width="10%">${spc}${p.editType.name}</td>
<td>
<tt>${p.path}</tt>
</td>
</tr>
</j:forEach>
</table>
</j:forEach>
<j:if test="${!hadChanges}">
<p>No Changes</p>
</j:if>
<br />
</j:if>
</div>
<!-- ARTIFACTS -->
<j:set var="artifacts" value="${build.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<div class="content">
<h1>Build Artifacts</h1>
<ul>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</ul>
</div>
</j:if>
<!-- MAVEN ARTIFACTS -->
<j:set var="mbuilds" value="${build.moduleBuilds}" />
<j:if test="${mbuilds!=null}">
<div class="content">
<h1>Build Artifacts</h1>
<j:forEach var="m" items="${mbuilds}">
<h2>${m.key.displayName}</h2>
<j:forEach var="mvnbld" items="${m.value}">
<j:set var="artifacts" value="${mvnbld.artifacts}" />
<j:if test="${artifacts!=null and artifacts.size()>0}">
<ul>
<j:forEach var="f" items="${artifacts}">
<li>
${f}
</li>
</j:forEach>
</ul>
</j:if>
</j:forEach>
</j:forEach>
<br />
</div>
</j:if>
</body>
</html>

Campaign Monitor importing template: unsubscript tag not found

I try to import an email-template in campaign monitor, but it shows always the same problem:
No unsubscribe link We require a single-click unsubscribe link in every campaign you send. Please add the tags and around the words you want to become an unsubscribe link.
What I do not understand is, that I have the tag in my template:
<layout label="POST-FOOTER25">
<table width="100%" bgcolor="#fff" cellpadding="0" cellspacing="0" border="0" id="backgroundTable">
<tbody>
<tr>
<td width="100%">
<table width="600" cellpadding="0" cellspacing="0" border="0" align="center" class="devicewidthinner">
<tbody>
<!-- Top Spacing -->
<tr>
<td width="100%" height="10" style="font-size: 0;line-height: 0;border-collapse: collapse;"> </td>
</tr>
<!-- Top Spacing -->
<tr>
<td width="100%">
<table width="560" cellpadding="0" cellspacing="0" border="0" align="center" class="devicewidthinner">
<tbody class="">
<tr class="">
<td width="100%" align="right" valign="middle" style="font-family: 'Open Sans', Arial, sans-serif; font-size: 12px; line-height: 16px; color: rgb(62, 69, 76); text-align: center; font-weight: 400;" mgedit="text" class="aligncenter">
<multiline label="text617_86">
<!--[if !mso]><!-->
<span style="font-family: 'Open Sans', Arial, sans-serif;">
<!--<![endif]-->
You are receiving this email because you subscribed for updates on our website. <unsubscribe>Click here to Unsubscribe</unsubscribe><br /><br />
<preferences>Manage your subscription</preferences>
<!--[if !mso]><!-->
</span>
<!--<![endif]-->
</multiline>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- Bottom Spacing -->
<tr>
<td width="100%" height="10" style="font-size: 0;line-height: 0;border-collapse: collapse;"> </td>
</tr>
<!-- Bottom Spacing -->
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</layout>
There is no comment or if-case around the unsubscribe-tag. Any other idea?
Greets, yab86
I'd recommend moving the unsubscribe and preferences markup out of the multiline markup area. It's likely their system doesn't recognize it because it's put into the editable multiline WYSIWYG Editor

Unix Regular Expression matching with grep

I am new to using regular expressions in unix console, so I have a question. I want to parse a web page and collect lines which contain anchor tag and place them in separate file.
So this prints nothing:
curl "https://www.google.ru/?gfe_rd=cr&ei=9fv6VMq4CoiFZIezgaAN#newwindow=1&q=site:https:%2F%2Ftwitter.com%2Fclimagic" | grep '<a '
HTML curl prints:
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="ru"><head><meta content="????? ?????????? ? ?????????: ??? ????????, ????????, ????? ? ?????? ??????." name="description"><meta content="noodp" name="robots"><meta content="/images/google_favicon_128.png" itemprop="image"><title>Google</title><script>(function(){window.google={kEI:'kAL7VOjwGKbvywO4moGQCQ',kEXPI:'3700294,3700362,4011559,4017578,4020347,4020562,4021338,4023678,4024599,4026473,4028716,4028875,4029042,4029050,4029141,4029155,4029403,4029515,4029796,4029798,4029961,4030109,8300096,8500393,8500572,8500799,8500948,10200083',authuser:0,kSID:'kAL7VOjwGKbvywO4moGQCQ'};google.kHL='ru';})();(function(){google.lc=[];google.li=0;google.getEI=function(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI};google.getLEI=function(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute("leid")));)a=a.parentNode;return b};google.https=function(){return"https:"==window.location.protocol};google.ml=function(){};google.time=function(){return(new Date).getTime()};google.log=function(a,b,e,f,l){var d=new Image,h=google.lc,g=google.li,c="",m=google.ls||"";d.onerror=d.onload=d.onabort=function(){delete h[g]};h[g]=d;if(!e&&-1==b.search("&ei=")){var k=google.getEI(f),c="&ei="+k;-1==b.search("&lei=")&&((f=google.getLEI(f))?c+="&lei="+f:k!=google.kEI&&(c+="&lei="+google.kEI))}a=e||"/"+(l||"gen_204")+"?atyp=i&ct="+a+"&cad="+b+c+m+"&zx="+google.time();/^http:/i.test(a)&&google.https()?(google.ml(Error("a"),!1,{src:a,glmm:1}),delete h[g]):(d.src=a,google.li=g+1)};google.y={};google.x=function(a,b){google.y[a.id]=[a,b];return!1};google.load=function(a,b,e){google.x({id:a+n++},function(){google.load(a,b,e)})};var n=0;})();google.kCSI={};var _gjwl=location;function _gjuc(){var a=_gjwl.href.indexOf("#");if(0<=a&&(a=_gjwl.href.substring(a),0<a.indexOf("&q=")||0<=a.indexOf("#q="))&&(a=a.substring(1),-1==a.indexOf("#"))){for(var d=0;d<a.length;){var b=d;"&"==a.charAt(b)&&++b;var c=a.indexOf("&",b);-1==c&&(c=a.length);b=a.substring(b,c);if(0==b.indexOf("fp="))a=a.substring(0,d)+a.substring(c,a.length),c=d;else if("cad=h"==b)return 0;d=c}_gjwl.href="/search?"+a+"&cad=h";return 1}return 0}
function _gjh(){!_gjuc()&&window.google&&google.x&&google.x({id:"GJH"},function(){google.nav&&google.nav.gjh&&google.nav.gjh()})};window._gjh&&_gjh();</script><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}#media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important}</style><style>body,td,a,p,.h{font-family:arial,sans-serif}body{margin:0;overflow-y:scroll}#gog{padding:3px 8px 0}td{line-height:.8em}.gac_m td{line-height:17px}form{margin-bottom:20px}.h{color:#36c}.q{color:#00c}.ts td{padding:0}.ts{border-collapse:collapse}em{font-weight:bold;font-style:normal}.lst{height:25px;width:496px}.gsfi,.lst{font:18px arial,sans-serif}.gsfs{font:17px arial,sans-serif}.ds{display:inline-box;display:inline-block;margin:3px 0 4px;margin-left:4px}input{font-family:inherit}a.gb1,a.gb2,a.gb3,a.gb4{color:#11c !important}body{background:#fff;color:black}a{color:#11c;text-decoration:none}a:hover,a:active{text-decoration:underline}.fl a{color:#36c}a:visited{color:#551a8b}a.gb1,a.gb4{text-decoration:underline}a.gb3:hover{text-decoration:none}#ghead a.gb2:hover{color:#fff !important}.sblc{padding-top:5px}.sblc a{display:block;margin:2px 0;margin-left:13px;font-size:11px}.lsbb{background:#eee;border:solid 1px;border-color:#ccc #999 #999 #ccc;height:30px}.lsbb{display:block}.ftl,#fll a{display:inline-block;margin:0 12px}.lsb{background:url(/images/srpr/nav_logo80.png) 0 -258px repeat-x;border:none;color:#000;cursor:pointer;height:30px;margin:0;outline:0;font:15px arial,sans-serif;vertical-align:top}.lsb:active{background:#ccc}.lst:focus{outline:none}.tiah{width:458px}</style><script></script></head><body bgcolor="#fff"><script>(function(){var src='/images/nav_logo176.png';var iesg=false;document.body.onload = function(){window.n && window.n();if (document.images){new Image().src=src;}
if (!iesg){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}
}
})();</script><div id="mngb"> <div id=gbar><nobr><b class=gb1>?????</b> <a class=gb1 href="https://www.google.ru/imghp?hl=ru&tab=wi">????????</a> <a class=gb1 href="https://maps.google.ru/maps?hl=ru&tab=wl">?????</a> <a class=gb1 href="https://play.google.com/?hl=ru&tab=w8">Play</a> <a class=gb1 href="https://www.youtube.com/?gl=RU&tab=w1">YouTube</a> <a class=gb1 href="https://news.google.ru/nwshp?hl=ru&tab=wn">???????</a> <a class=gb1 href="https://mail.google.com/mail/?tab=wm">?????</a> <a class=gb1 href="https://drive.google.com/?tab=wo">????</a> <a class=gb1 style="text-decoration:none" href="http://www.google.ru/intl/ru/options/"><u>???</u> »</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span> <div><style>.pmoabs{background-color:#fff;border:1px solid #E5E5E5;color:#666;font-size:13px;padding-bottom:20px;position:absolute;right:2px;top:3px;z-index:986}#pmolnk{border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px}.kd-button-submit{border:1px solid #3079ed;background-color:#4d90fe;background-image:-webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#4787ed));background-image:-webkit-linear-gradient(top,#4d90fe,#4787ed);background-image:-moz-linear-gradient(top,#4d90fe,#4787ed);background-image:-ms-linear-gradient(top,#4d90fe,#4787ed);background-image:-o-linear-gradient(top,#4d90fe,#4787ed);background-image:linear-gradient(top,#4d90fe,#4787ed);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#4d90fe',EndColorStr='#4787ed')}.kd-button-submit:hover{border:1px solid #2f5bb7;background-color:#357ae8;background-image:-webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#357ae8));background-image:-webkit-linear-gradient(top,#4d90fe,#357ae8);background-image:-moz-linear-gradient(top,#4d90fe,#357ae8);background-image:-ms-linear-gradient(top,#4d90fe,#357ae8);background-image:-o-linear-gradient(top,#4d90fe,#357ae8);background-image:linear-gradient(top,#4d90fe,#357ae8);filter:progid:DXImageTransform.Microsoft.gradient(startColorStr='#4d90fe',EndColorStr='#357ae8')}.kd-button-submit:active{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.3);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.3);box-shadow:inset 0 1px 2px rgba(0,0,0,0.3)}#pmolnk a{color:#fff;display:inline-block;font-weight:bold;padding:5px 20px;text-decoration:none;white-space:nowrap}.xbtn{color:#999;cursor:pointer;font-size:23px;line-height:5px;padding-top:5px}.padi{padding:0 8px 0 10px}.padt{padding:5px 20px 0 0;color:#444}.pads{text-align:left;max-width:200px}</style> <div class="pmoabs" id="pmocntr2" style="behavior:url(#default#userdata);display:none"> <table border="0"> <tr> <td colspan="2"> <div class="xbtn" onclick="google.promos&&google.promos.toast&& google.promos.toast.cpc()" style="float:right">×</div> </td> </tr> <tr> <td class="padi" rowspan="2"> <img src="/images/icons/product/chrome-48.png"> </td> <td class="pads">Google ????? ?????? ??? ?????.</td> </tr> <tr> <td class="padt"> <div class="kd-button-submit" id="pmolnk"> <a href="/chrome/index.html?hl=ru&brand=CHNG&utm_source=ru-hpp&utm_medium=hpp&utm_campaign=ru" onclick="google.promos&&google.promos.toast&& google.promos.toast.cl()">?????????? Google Chrome </div> </td> </tr> </table> </div> <script type="text/javascript">(function(){var a={o:{}};a.o.qa=50;a.o.oa=10;a.o.Y="body";a.o.Oa=!0;a.o.Ra=function(b,c){var d=a.o.Ea();a.o.Ga(d,b,c);a.o.Sa(d);a.o.Oa&&a.o.Pa(d)};a.o.Sa=function(b){(b=a.o.$(b))&&0<b.forms.length&&b.forms[0].submit()};a.o.Ea=function(){var b=document.createElement("iframe");b.height=0;b.width=0;b.style.overflow="hidden";b.style.top=b.style.left="-100px";b.style.position="absolute";document.body.appendChild(b);return b};a.o.$=function(b){return b.contentDocument||b.contentWindow.document};a.o.Ga=function(b,c,d){b=a.o.$(b);b.open();d=["<",a.o.Y,'><form method=POST action="',d,'">'];for(var e in c)c.hasOwnProperty(e)&&d.push('<textarea name="',e,'">',c[e],"</textarea>");d.push("</form></",a.o.Y,">");b.write(d.join(""));b.close()};a.o.ba=function(b,c){c>a.o.oa?google&&google.ml&&google.ml(Error("ogcdr"),!1,{cause:"timeout"}):b.contentWindow?a.o.Qa(b):window.setTimeout(function(){a.o.ba(b,c+1)},a.o.qa)};a.o.Qa=function(b){document.body.removeChild(b)};a.o.Pa=function(b){a.o.Ca(b,"load",function(){a.o.ba(b,0)})};a.o.Ca=function(b,c,d){b.addEventListener?b.addEventListener(c,d,!1):b.attachEvent&&b.attachEvent("on"+c,d)};var m={Va:0,D:1,F:2,K:5};a.k={};a.k.M={ka:"i",J:"d",ma:"l"};a.k.A={N:"0",G:"1"};a.k.O={L:1,J:2,I:3};a.k.v={ea:"a",ia:"g",C:"c",ya:"u",xa:"t",N:"p",pa:"pid",ga:"eid",za:"at"};a.k.la=window.location.protocol+"//www.google.com/_/og/promos/";a.k.ha="g";a.k.Aa="z";a.k.S=function(b,c,d,e){var f=null;switch(c){case m.D:f=window.gbar.up.gpd(b,d,!0);break;case m.K:f=window.gbar.up.gcc(e)}return null==f?0:parseInt(f,10)};a.k.Ka=function(b,c,d){return c==m.D?null!=window.gbar.up.gpd(b,d,!0):!1};a.k.P=function(b,c,d,e,f,h,k,l){var g={};g[a.k.v.N]=b;g[a.k.v.ia]=c;g[a.k.v.ea]=d;g[a.k.v.za]=e;g[a.k.v.ga]=f;g[a.k.v.pa]=1;k&&(g[a.k.v.C]=k);l&&(g[a.k.v.ya]=l);if(h)g[a.k.v.xa]=h;else return google.ml(Error("knu"),!1,{cause:"Token is not found"}),null;return g};a.k.V=function(b,c,d){if(b){var e=c?a.k.ha:a.k.Aa;c&&d&&(e+="?authuser="+d);a.o.Ra(b,a.k.la+e)}};a.k.Fa=function(b,c,d,e,f,h,k){b=a.k.P(c,b,a.k.M.J,a.k.O.J,d,f,null,e);a.k.V(b,h,k)};a.k.Ia=function(b,c,d,e,f,h,k){b=a.k.P(c,b,a.k.M.ka,a.k.O.L,d,f,e,null);a.k.V(b,h,k)};a.k.Na=function(b,c,d,e,f,h,k,l,g,n){switch(c){case m.K:window.gbar.up.dpc(e,f);break;case m.D:window.gbar.up.spd(b,d,1,!0);break;case m.F:g=g||!1,l=l||"",h=h||0,k=k||a.k.A.G,n=n||0,a.k.Fa(e,h,k,f,l,g,n)}};a.k.La=function(b,c,d,e,f){return c==m.D?0<d&&a.k.S(b,c,e,f)>=d:!1};a.k.Ha=function(b,c,d,e,f,h,k,l,g,n){switch(c){case m.K:window.gbar.up.iic(e,f);break;case m.D:c=a.k.S(b,c,d,e)+1;window.gbar.up.spd(b,d,c.toString(),!0);break;case m.F:g=g||!1,l=l||"",h=h||0,k=k||a.k.A.N,n=n||0,a.k.Ia(e,h,k,1,l,g,n)}};a.k.Ma=function(b,c,d,e,f,h){b=a.k.P(c,b,a.k.M.ma,a.k.O.I,d,e,null,null);a.k.V(b,f,h)};var p={Ta:"a",Wa:"l",Ua:"c",fa:"d",I:"h",L:"i",gb:"n",G:"x",cb:"ma",eb:"mc",fb:"mi",Xa:"pa",Ya:"pc",$a:"pi",bb:"pn",ab:"px",Za:"pd",hb:"gpa",jb:"gpi",kb:"gpn",lb:"gpx",ib:"gpd"};a.i={};a.i.s={na:"hplogo",wa:"pmocntr2"};a.i.A={va:"0",G:"1",da:"2"};a.i.p=document.getElementById(a.i.s.wa);a.i.ja=16;a.i.ra=2;a.i.ta=20;google.promos=google.promos||{};google.promos.toast=google.promos.toast||{};a.i.H=function(b){a.i.p&&(a.i.p.style.display=b?"":"none",a.i.p.parentNode&&(a.i.p.parentNode.style.position=b?"relative":""))};a.i.ca=function(b){try{if(a.i.p&&b&&b.es&&b.es.m){var c=window.gbar.rtl(document.body)?"left":"right";a.i.p.style[c]=b.es.m-a.i.ja+a.i.ra+"px";a.i.p.style.top=a.i.ta+"px"}}catch(d){google.ml(d,!1,{cause:a.i.w+"_PT"})}};google.promos.toast.cl=function(){try{a.i.Q==m.F&&a.k.Ma(a.i.T,a.i.B,a.i.A.da,a.i.X,a.i.U,a.i.W),window.gbar.up.sl(a.i.B,a.i.w,p.I,a.i.R(),1)}catch(b){google.ml(b,!1,{cause:a.i.w+"_CL"})}};google.promos.toast.cpc=function(){try{a.i.p&&(a.i.H(!1),a.k.Na(a.i.p,a.i.Q,a.i.s.Z,a.i.T,a.i.Da,a.i.B,a.i.A.G,a.i.X,a.i.U,a.i.W),window.gbar.up.sl(a.i.B,a.i.w,p.fa,a.i.R(),1))}catch(b){google.ml(b,!1,{cause:a.i.w+"_CPC"})}};a.i.aa=function(){try{if(a.i.p){var b=276,c=document.getElementById(a.i.s.na);c&&(b=Math.max(b,c.offsetWidth));var d=parseInt(a.i.p.style.right,10)||0;a.i.p.style.visibility=2*(a.i.p.offsetWidth+d)+b>document.body.clientWidth?"hidden":""}}catch(e){google.ml(e,!1,{cause:a.i.w+"_HOSW"})}};a.i.Ba=function(){var b=["gpd","spd","aeh","sl"];if(!window.gbar||!window.gbar.up)return!1;for(var c=0,d;d=b[c];c++)if(!(d in window.gbar.up))return!1;return!0};a.i.Ja=function(){return a.i.p.currentStyle&&"absolute"!=a.i.p.currentStyle.position};google.promos.toast.init=function(b,c,d,e,f,h,k,l,g,n,q,r){try{a.i.Ba()?a.i.p&&(e==m.F&&!l==!g?(google.ml(Error("tku"),!1,{cause:"zwieback: "+g+", gaia: "+l}),a.i.H(!1)):(a.i.s.C="toast_count_"+c+(q?"_"+q:""),a.i.s.Z="toast_dp_"+c+(r?"_"+r:""),a.i.w=d,a.i.B=b,a.i.Q=e,a.i.T=c,a.i.Da=f,a.i.X=l?l:g,a.i.U=!!l,a.i.W=k,a.k.Ka(a.i.p,e,a.i.s.Z,c)||a.k.La(a.i.p,e,h,a.i.s.C,c)||a.i.Ja()?a.i.H(!1):(a.k.Ha(a.i.p,e,a.i.s.C,c,f,a.i.B,a.i.A.va,a.i.X,a.i.U,a.i.W),n||(window.gbar.up.aeh(window,"resize",a.i.aa),window.lol=
a.i.aa,window.gbar.elr&&a.i.ca(window.gbar.elr()),window.gbar.elc&&window.gbar.elc(a.i.ca),a.i.H(!0)),window.gbar.up.sl(a.i.B,a.i.w,p.L,a.i.R())))):google.ml(Error("apa"),!1,{cause:a.i.w+"_INIT"})}catch(t){google.ml(t,!1,{cause:a.i.w+"_INIT"})}};a.i.R=function(){var b=a.k.S(a.i.p,a.i.Q,a.i.s.C,a.i.T);return"ic="+b};})();</script> <script type="text/javascript">(function(){var sourceWebappPromoID=143011;var sourceWebappGroupID=5;var payloadType=5;var cookieMaxAgeSec=2592000;var dismissalType=5;var impressionCap=25;var gaiaXsrfToken='';var zwbkXsrfToken='';var kansasDismissalEnabled=false;var sessionIndex=0;var invisible=false;window.gbar&&gbar.up&&gbar.up.r&&gbar.up.r(payloadType,function(show){if (show){google.promos.toast.init(sourceWebappPromoID,sourceWebappGroupID,payloadType,dismissalType,cookieMaxAgeSec,impressionCap,sessionIndex,gaiaXsrfToken,zwbkXsrfToken,invisible,'0612');}
});})();</script> </div> </span><br clear="all" id="lgpd"><div id="lga"><div style="padding:28px 0 3px"><div style="height:110px;width:276px;background:url(/images/srpr/logo9w.png) no-repeat" title="Google" align="left" id="hplogo" onload="window.lol&&lol()"><div nowrap="" style="color:#777;font-size:16px;font-weight:bold;position:relative;top:70px;left:218px">??????</div></div></div><br></div><form action="/search" name="f"><table cellpadding="0" cellspacing="0"><tr valign="top"><td width="25%"> </td><td align="center" nowrap=""><input name="ie" value="windows-1251" type="hidden"><input value="ru" name="hl" type="hidden"><input name="source" type="hidden" value="hp"><div class="ds" style="height:32px;margin:4px 0"><div style="position:relative;zoom:1"><input style="color:#000;margin:0;padding:5px 8px 0 6px;vertical-align:top;padding-right:38px" autocomplete="off" class="lst tiah" value="" title="????? ? Google" maxlength="2048" name="q" size="57"><img src="/textinputassistant/tia.png" style="position:absolute;cursor:pointer;right:5px;top:4px;z-index:300" onclick="(function(){var src='/textinputassistant/11/ru_tia.js';var s=document.createElement('script');s.src=src;google.dom.append(s);})();" alt="" height="23" width="27"></div></div><br style="line-height:0"><span class="ds"><span class="lsbb"><input class="lsb" value="????? ? Google" name="btnG" type="submit"></span></span><span class="ds"><span class="lsbb"><input class="lsb" value="??? ??????!" name="btnI" onclick="if(this.form.q.value)this.checked=1; else top.location='/doodles/'" type="submit"></span></span></td><td class="fl sblc" align="left" nowrap="" width="25%">??????????? ????????????? ???????????</td></tr></table><input id="gbv" name="gbv" type="hidden" value="1"></form><div id="gac_scont"></div><div style="font-size:83%;min-height:3.5em"><br></div><span id="footer"><div style="font-size:10pt"><div style="margin:19px auto;text-align:center" id="fll">????????? ???????????????? ??? ???????+Google?? ? GoogleGoogle.com</div></div><p style="color:#767676;font-size:8pt">© 2015 - ?????????????????? - ???????</p></span></center><div id="xjsd"></div><div id="xjsi" data-jiis="bp"><script>(function(){function c(b){window.setTimeout(function(){var a=document.createElement("script");a.src=b;document.getElementById("xjsd").appendChild(a)},0)}google.dljp=function(b,a){google.xjsu=b;c(a)};google.dlj=c;})();(function(){window.google.xjsrm=[];})();if(google.y)google.y.first=[];if(!google.xjs){window._=window._||{};window._._DumpException=function(e){throw e};if(google.timers&&google.timers.load.t){google.timers.load.t.xjsls=new Date().getTime();}google.dljp('/xjs/_/js/k\x3dxjs.hp.en_US.n3_mzAr3_Yc.O/m\x3dsb_he,d/rt\x3dj/d\x3d1/t\x3dzcms/rs\x3dACT90oHQWmzo3RD0Vkp_abygcs3cNxmhFg','/xjs/_/js/k\x3dxjs.hp.en_US.n3_mzAr3_Yc.O/m\x3dsb_he,d/rt\x3dj/d\x3d1/t\x3dzcms/rs\x3dACT90oHQWmzo3RD0Vkp_abygcs3cNxmhFg');google.xjs=1;}google.pmc={"sb_he":{"agen":true,"cgen":true,"client":"heirloom-hp","dh":true,"ds":"","exp":"msedr","fl":true,"host":"google.ru","jam":0,"jsonp":true,"msgs":{"cibl":"??????? ????????? ??????","dym":"????????, ?? ????? ? ????:","lcky":"??? ??????!","lml":"?????????...","oskt":"???????? ??????????","psrc":"???? ?????? ??? ?????? ?? ????? \u003Ca href=\"/history\"\u003E??????? ???-??????\u003C/a\u003E","psrl":"???????","sbit":"????? ?? ????????","srch":"????? ? Google"},"ovr":{},"pq":"","refoq":true,"scd":10,"sce":5,"stok":"NE1h42VX-LGhd_YH7vg7l4DQglo"},"d":{}};google.y.first.push(function(){if(google.med){google.med('init');google.initHistory();google.med('history');}});if(google.j&&google.j.en&&google.j.xi){window.setTimeout(google.j.xi,0);}
For extended regular expressions use egrep, and as far as i understand you just want to pull anchor tag try:
curl <your link> | egrep -o '<a.*/a>' '
-o : This prints only the matching part of line
'<a.*/a>' : extracts anything between anchor tags

Resources