1. Jonathan Ashwell
  2. Valentina Database ADK
  3. Monday, April 05 2021, 03:09 PM
  4.  Subscribe via email
I've been using Valentina.EscapeString() for Regex searches, but the searches fail if they have characters like (, ), or ? I see these characters aren't being escaped properly to

\(
\)
\?

I can add the \ myself and now the Regex searches work.

What does Valentina.escapestring do, then? Should I roll my own escape method?
Comment
There are no comments made yet.
Sergey Pashkov Accepted Answer
Hello Jonathan,

Valentina.EscapeString() escapes ' and \ characters. The returned string can be safely used as a string (single-quoted) literal in the SQL query.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 1
Jonathan Ashwell Accepted Answer
Thanks. So the answer is yes, we must escape any other reserved characters ourselves.
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 2
Ruslan Zasukhin Accepted Answer
Hi Jon,

we have seen that existed attempts to add REGEX chars to this function Valentina.EscapeString()
But later they were removed. We need to return back to this point I think
Comment
There are no comments made yet.
  1. more than a month ago
  2. Valentina Database ADK
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.