Characters only but allowing accent

Is it possible to restrict an alphanumeric question to strings only, while allowing accents (for french surveys) ?


There may be other, more elegant ways, but here’s a solution I see:

// accept alphanumeric characters
// see more here:


// or French accents
// see more here:

Alternatively, one could use regular expressions. There are more elegant ways to designate sets of characters or permit case-insensitive matching, but I’m writing it in long-form for clarity:

// check whether `my_text_var` matches the regex mattern in quotes
// in this case, contains 1+ of the characters in brackets
    // letters A-Z, a-z, numbers, or French accents
   "[A-Za-z0-9ÀÂÄÉÈÊËÎÏÔÖÙÛÜàâäéèêëîïôöùûü ]+" 

See relevant C# documentation here.

Others will hopefully have better suggestions.

1 Like

Hm, the first solution doesn’t work because in a text with ordinary letters and accented letters both expressions will be false.

Regular expressions will work, but you have to include more letters like ô and ç, etc.
A better expression would be


which allows any Unicode character with the ‘letter’ property.
This will also work for spanish, portuguese, german, etc. (e.g. ñ, ã, ä, ß, etc.)
The full validation expression is:

System.Text.RegularExpressions.Regex.IsMatch(self, “^\p{L}+$”)


Just to add on Klaus great suggestion:

If I see it correctly, to use it in Survey Solutions you’d need to use two backslashes for escaping sequence, so the expression would be:


System.Text.RegularExpressions.Regex.IsMatch(self, "^\\p{L}+$")


That’s correct and it is exactly what I pasted into my comment.
Now I see that the paste operation removes (interprets?) one of the backslashes?!

1 Like

Thank you all for your very helpful comments! It worked!

See here:

and here:

This is not related to regular expressions. You can try with a string variable.


Then display on the screen the value of %t%.

Best, Sergiy Radyakin