preg_match accented characters
<p>I have an issue using preg_match with php.</p>
<p>I want my users to fill the <em>Name</em> field with only valid characters.
Ex: no numbers or special chars.</p>
<p>My site will eventually be bilingual but most of my visitors are french Canadians</p>
<p>I prefer utf-8 for my encoding.
So at the top of my document i have this tag :</p>
<pre><code>&lt;meta charset=&quot;utf-8&quot; /&gt;
</code></pre>
<p>I need to accept accented characters in my form and i have tryed this :</p>
<pre><code>(preg_match('/^\p{L}+$/ui',$string))
</code></pre>
<p>But i cant get accent to be accepted this way.</p>
<p>Here is an example of what a name could contain as characters</p>
<blockquote>
<p><em>jean-françois d'abiguäel</em></p>
</blockquote>
<p>That's pretty much as bad as it could get</p>
<p>Everyone seems to get <code>(preg_match('/^\p{L}+$/ui',$string))</code> working, but me.</p>
<p>I would need something like this :</p>
<pre><code>/^\p{L}(\p{L}+[- ']?)*\p{L}$/ui
</code></pre>
<p>But i need to get it working.</p>
<p>My servers are IIS (godaddy)
PHP Version is 5.4
default timezone is set to America/Montreal</p>
<p>Thank you!</p>