From 6a0db13642c0f9bc92972dd235709397cbb11020 Mon Sep 17 00:00:00 2001
From: Dave Smith <getdavemail@gmail.com>
Date: Thu, 12 Aug 2021 12:12:13 +0100
Subject: [PATCH] Make both regexes literal

---
 .../src/components/rich-text/use-paste-handler.js             | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/block-editor/src/components/rich-text/use-paste-handler.js b/packages/block-editor/src/components/rich-text/use-paste-handler.js
index 4b685924e4865b..c12e84720649f8 100644
--- a/packages/block-editor/src/components/rich-text/use-paste-handler.js
+++ b/packages/block-editor/src/components/rich-text/use-paste-handler.js
@@ -234,8 +234,8 @@ export function usePasteHandler( props ) {
  * @return {string} the normalized html
  */
 function removeWindowsFragments( html ) {
-	const startReg = new RegExp( '.*<!--StartFragment-->', 's' );
-	const endReg = new RegExp( '<!--EndFragment-->.*', 's' );
+	const startReg = /.*<!--StartFragment-->/s;
+	const endReg = /<!--EndFragment-->.*/s;
 
 	return html.replace( startReg, '' ).replace( endReg, '' );
 }