---
title: "System::Text::RegularExpressions::Regex::Escape method"
url: "https://reference.aspose.com/tex/cpp/system.text.regularexpressions/regex/escape/"
product: "Aspose.TeX for C++"
description: "System::Text::RegularExpressions::Regex::Escape method. Escapes special characters to use string as part of the pattern in C++."
---

## Regex::Escape method


Escapes special characters to use string as part of the pattern.

```cpp
static String System::Text::RegularExpressions::Regex::Escape(const String &str)
```


| Parameter | Type | Description |
| --- | --- | --- |
| str | const String\& | [String](../../../system/string/) to escape special characters in. |

### ReturnValue

[String](../../../system/string/) with escaped special characters.

## See Also

* Class [String](../../../system/string/)
* Class [Regex](../)
* Namespace [System::Text::RegularExpressions](../../)
* Library [Aspose.TeX for C++](../../../)
