logo       

How to include a string into a regex comparison?: msg#02360

ruby-talk

Subject: How to include a string into a regex comparison?

Hi, I don't get solving the following issue (sure it's easy but I cannot do it):


valid_content_type = "application/auth-policy+xml"
received_content_type = "application/auth-policy+xml;charset=ISO-8859-1"

received_content_type =~ /^application\/auth\-policy\+xml;?/
=> 0

received_content_type =~ /^#{received_content_type};?/
=> nil

How to fix it? Thanks a lot.



--
IÃaki Baz Castillo
<ibc@xxxxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise