Create a regex to extract a string that contain a noral character and escaped string without DOS

I have a string like this:

///////AB?\a\b\c\d\d\e\\f\a\a\b\cd\ed\fmnopqrstuvwxy\z\a\a\a\a\a\a\a\a\a///imgy

it started with /// and ended with ///imgy (i and/or m and/or g and/or y), and between the beginning and end are the character are normal character like a or escaped character like \a.

Here is my regex:

/^\/{3}((?:\\?[\s\S])+?)\/{3}([imgy]{0,4})(?!\w)/

But the problem is that it is reported as "vulnerable to denial-of-service attacks". The main part that has the problem is

(?:\\?[\s\S])+

How can I create a right one that can figure out both a and \a? Thank you!

90 thoughts on “Create a regex to extract a string that contain a noral character and escaped string without DOS”

  1. 194903 732065Up to now, you call for to term of hire an absolute truck or van and will also be removal equipments to valuable items plus have a look at the new destination. From the long run, which end up with are few points except anxiety moreover stress and anxiety. removals stockport 995175

    Reply