fix catastrophic backtracking when removing HTML comments (#40223)
fix catastrophic backtracking when removing HTML comments (#40223)

* fix catastrophic backtracking when removing HTML comments

The regexp `/<!--(.|\s)*?-->/g` can experience catastrophic backtracking while matching a string like `<!--                                           -- >` (notice how it does not end with `-->`).    

[You can see the catastrophic backtracking in action here](https://regex101.com/r/2jvwFi/1/debugger). 

This is because both `.` and `\s` matches the space character, and there are therefore a large number of possible ways for `(.|\s)*` to match a long sequence of spaces.  
The regexp evaluator is greedy, and the problem therefore only exists when the string does not match the regexp. 

The fix is simply to remove the ambiguity such that there is only one possible way for the regexp to match a sequence of white-space.

* Update client/src/utils/curriculum-helpers.js

Co-authored-by: Oliver Eyton-Williams <1737a7e4c5f47f3dbe525442bc142c9bcdf72ad0@gmail.com>

Co-authored-by: Oliver Eyton-Williams <1737a7e4c5f47f3dbe525442bc142c9bcdf72ad0@gmail.com>
raisedadead/FreeCodeCamp,raisedadead/FreeCodeCamp,FreeCodeCamp/FreeCodeCamp,FreeCodeCamp/FreeCodeCamp