r check if string contains special characters
<p>I am checking if a string contains any special characters. This is what I have, and its not working,</p>

<pre><code>    if(grepl('^\\[:punct:]', val))
</code></pre>

<p>So if anybody can tell me what I am missing, that will be helpful.</p>

<h2>Special characters</h2>

<pre><code>        ~ ` ! @# $ % ^ &amp; * | : ; , ." |
</code></pre>