ProtoFlux:Escape String: Difference between revisions

From Resonite Wiki
Added a note to not get confused on what node to use with string escaping.
cleanup
 
Line 12: Line 12:
|}}
|}}


Escape String escapes strings with '\' according to the Microsoft implementation [https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.escape?view=netframework-4.6 4.6 escape string]
The '''Escape String''' node escapes strings by adding <code>\</code> behind special characters. Its intention is for use in an environment with [https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions .NET Regular Expressions], but since Resonite does not currently implement any user-facing regex, its usefulness is limited.


{{Note|If you need [https://en.wikipedia.org/wiki/Percent-encoding percent encoding] for network communication outside of Resonite, use the [[ProtoFlux:Escape Uri Data String|escape url data string]] node instead.|suggestion}}
{{Note|If you need [https://en.wikipedia.org/wiki/Percent-encoding percent encoding] for network communication outside of Resonite, use the [[ProtoFlux:Escape Uri Data String|Escape Uri Data String]] node instead.|suggestion}}
 
=== String ([[Type:String|String]]) ===


=== String ([[Type:string|string]]) ===
The string to escape.
The string to escape.


=== * ([[Type:String|String]]) ===
=== * ([[Type:string|string]]) ===
 
The escaped string with <code>\</code> added behind the following characters: <code>\</code>, <code>*</code>, <code>+</code>, <code>?</code>, <code>|</code>, <code>{</code>, <code>[</code>, <code>(</code>, <code>)</code>, <code>^</code>, <code>$</code>, <code>.</code>, <code>#</code>, and [[ProtoFlux:Is White Space|whitespace characters]].
The escaped string with '\' according to the Microsoft implementation [https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.escape?view=netframework-4.6 4.6 escape string].


== Examples ==
== Examples ==
Line 29: Line 27:
File:Protoflux_example_Escape_String.webp|Escape String being used in some ProtoFlux code.
File:Protoflux_example_Escape_String.webp|Escape String being used in some ProtoFlux code.
</gallery>
</gallery>
== See Also ==
* [https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference Microsoft documentation for its regular expression language].
* [https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.escape?view=netframework-4.6 Microsoft documentation for the <code>Regex.Escape(String)</code> method].


[[Category:ProtoFlux:Strings]]
[[Category:ProtoFlux:Strings]]

Latest revision as of 00:09, 25 May 2024

Escape String
String
*
Strings

The Escape String node escapes strings by adding \ behind special characters. Its intention is for use in an environment with .NET Regular Expressions, but since Resonite does not currently implement any user-facing regex, its usefulness is limited.

If you need percent encoding for network communication outside of Resonite, use the Escape Uri Data String node instead.

String (string)

The string to escape.

* (string)

The escaped string with \ added behind the following characters: \, *, +, ?, |, {, [, (, ), ^, $, ., #, and whitespace characters.

Examples

See Also