REGEX-Escape for: \Q<div class="tabular"> <div class="<%= @modal ? '' ...

Your Input:
Result, the escaped string:
\\Q\
\
\
\

\\E\(\(\.\|\\n\)\*\) \

\<\/div\> \
\<%\= render \:partial \=\> 'form_attributes', \:locals \=\> \{\:f \=\> f, \:contact \=\> contact\} \-%\> \<\/div\> \<\/div\>

What must the escaping look like for:
\Q<div class="tabular"> <div class="<%= @modal ? '' : 'splitcontent'%>"> <div class="<%= @modal ? '' : 'splitcontentleft size-7'%>"> <p id="easy_contact_types" > \E((.|\n)*) <div id="easy-contact-whisperer"></div> <div id="contact-type-attributes"> <%= render :partial => 'form_attributes', :locals => {:f => f, :contact => contact} -%> </div> </div>

The excaped text for use in a regex is:
\\Q\<div class\="tabular"\> \<div class\="\<%\= @modal \? '' \: 'splitcontent'%\>"\> \<div class\="\<%\= @modal \? '' \: 'splitcontentleft size\-7'%\>"\> \<p id\="easy_contact_types" \> \\E\(\(\.\|\\n\)\*\) \<div id\="easy\-contact\-whisperer"\>\<\/div\> \<div id\="contact\-type\-attributes"\> \<%\= render \:partial \=\> 'form_attributes', \:locals \=\> \{\:f \=\> f, \:contact \=\> contact\} \-%\> \<\/div\> \<\/div\>