Uncaught SyntaxError: Unexpected identifier in chrome's console
<pre><code>var pattern = new RegExp(/^[a-zA-Z0-9_\.\-]+$/);
if(!pattern.test($(this).val()){
    $('#rlog div.ttc').prop('class','tooltip ttc bad').html('Используйте символы A-Z, a-z и 0-9');
}
</code></pre>

<p>Uncaught SyntaxError: Unexpected identifier on the line in the if.
But there are no mistakes if I write something like this:</p>

<pre><code>var pattern = new RegExp(/^[a-zA-Z0-9_\.\-]+$/);
$('#rlog div.ttc').prop('class','tooltip ttc bad').html('Используйте символы A-Z, a-z и 0-9');
</code></pre>

<p>I have no idea what the problem is. Hope, you'll help me</p>
