Hi,
In order to build correct regular expressions, it is often necessary to escape reserved characters in the string to be searched. This is especially true when the string comes from a user-generated input (for example, the name of an email attachment).
For this, the following C# method can be used:
A similar method probably exists for the Java stack.
Regards,
Rui