On Wed, Feb 2, 2011 at 1:37 PM, Jeremy Bopp <jeremy / bopp.net> wrote:
> On 2/2/2011 12:19 PM, Bob Hatch wrote:
>> I have the following variable. Ruby looks at the =3D sign as a regex
>> literal and I need it to be recognized as text.
>>
>> search_text =3D! %r{
>> =A0 =3D
>> }x
>
> You have a typo in your code sample here, and the message you see as a
> result is:
>
> warning: regex literal in condition
>
> That is because of the =3D! you have. =A0Ruby breaks that down into an
> assigment (the =3D part) and a boolean negation (the ! part) of the
> following regexp. =A0You need to change the =3D! to just =3D as follows:
>
> search_text =3D %r{
> =A0=3D
> }

I think he meant to use =3D~ instead.