From 263eb0243b6e2aeb22c93e6ca991f6f8b058d3e9 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 27 Mar 2024 14:30:55 -0400 Subject: [PATCH] Editorial: Improve the note contrasting RegExp.escape with EscapeRegExpPattern --- spec.emu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.emu b/spec.emu index cacc5a1..b6cb9ab 100644 --- a/spec.emu +++ b/spec.emu @@ -40,7 +40,7 @@ contributors: Jordan Harband -

`escape` takes a string and escapes it so it can be literally represented as a pattern. In contrast EscapeRegExpPattern (as the name implies) takes a pattern and escapes it so that it can be represented as a string. While the two are related, they do not share the same character escape set or perform similar actions.

+

Despite having similar names, EscapeRegExpPattern and `RegExp.escape` do not perform similar actions. The former escapes a pattern for representation as a string, while this function escapes a string for representation inside a pattern.