Regex problems with non-ascii characters

  • Автор темы Автор темы peter
  • Дата начала Дата начала

peter

Пользователь
Регистрация
07.01.2012
Сообщения
40
Реакции
2
Баллы
8
Hi,

ZP behaves quite weird when a regexp expression has certain non-ASCII characters. Just one example: when the ellipsis is not written with three points like ... but with the proper character: …
I have attached an example file plus a screenshot of its result. You can see that only one character is replaced, while the others are intact.

Are you aware of the problem?
Thanks!
 

Вложения

  • ellipsis-regexp-test.xmlz
    ellipsis-regexp-test.xmlz
    9,4 KB · Просмотры: 285
  • ell.png
    ell.png
    49,2 KB · Просмотры: 603
use System.Text.RegularExpressions.Regex
it works fine
 
LexxWork, Thank you for your quick reply & workaround! May I have some more questions?
- could you just paste the code I should use in the c# block?
- what is your experience, are these kind of c#-based regex matches faster than the ”normal” regex?
 
simple code
C#:
Развернуть Свернуть Копировать
string your_variable = project.Variables["text"].Value; // "…………………"
return System.Text.RegularExpressions.Regex.Replace(your_variable, "…", "-");
image.png
 
  • Спасибо
Реакции: peter
LexxWork, большое спасибо! It works - also checked whether it is faster than the build regex match, ...just for the record, found no difference.
 
Anyway, it would be nice to have this bug fixed. Thanks!
 
Ooops, I am sorry, then the problem was located between the chair and the keyboard.. ;)
Anyway this was an example file just to illustrate the problem. I do have had some oddities with regexps, but 'll try to investigate it further so that I could reproduce it, sorry for this again.
 
We do not use any special lib for reg expressions. standard NET
i doubt there are any errors. anyway, any particular example is welcomed.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)