Skip to content
Snippets Groups Projects

F escape

Merged Henrik tom Wörden requested to merge f-escape into dev
Files
3
+ 19
0
@@ -623,3 +623,22 @@ def _same_id_as_resolved_entity(this, that):
if not isinstance(this, Entity) and isinstance(that, Entity):
return that.id is not None and that.id == this
return this == that
def escape_quoted_text(text: str) -> str:
"""The characters `\` and `*` need to be escaped if used in quoted expressions in the query
language.
This function return the given string where the characters `\` and `*` are escaped by a `\`.
Parameters
----------
text : str
The text to be escaped
Returns
-------
str
The escaped text
"""
return text.replace('\\', r'\\').replace('*', r'\*')
Loading