December 19th, 2013, 04:23 AM
RegEx doesn't find special letters
I have a problem with special Letters like hex(c2)
My regex doesn't find that this is not allowed:
greetings from Germany
December 19th, 2013, 05:04 AM
At which system do you try to run it?
What kind of data do you want to match it against?
December 19th, 2013, 06:19 AM
I use C#, but this is not importand because the regEx doesn't find this not allowed letter. I tried it also at derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx
The datas are in XML-File and posted to our webservice.
I tried to post the phrase, but it doesn't work. Hex(c2) is not allowed here
December 19th, 2013, 09:31 AM
You are using \w, which does seems to accept the Hex(c2) letter Â.
If you for example only want to allow A-Z and a-z, you could try to specify that instead of \w.
Last edited by MrFujin; December 19th, 2013 at 09:34 AM.
December 19th, 2013, 10:23 AM
I tried it, but sorry, it doesn't work because
\w is the same as [A-Za-z0-9_]
Perhaps this patern is invisible. I cant't see it in NP++ or Windows Editor. I only see it in the HexEditor from NP++
December 19th, 2013, 10:55 AM
This is the Hex Code from the whole String:
41 6c 74 65 73 20 52 61 64 c2 a0 31
January 3rd, 2014, 08:19 AM
I found the solution.
\s means all kinds of spaces
if I take \x20 for the hexCode Space the problem was gone