Closed panhezeng closed 6 years ago
@panhezeng
Thank you for the review! But the characters =
, -
, .
, +
and *
are considered metacharacters in regular expressions and – at least in my opinion – should always be escaped when they represent normal characters.
Best,
--madmurphy
For example
/[\-\.\+\*]/g
Better/[-.+*]/g
For example
/^(?:expires|max\-age|path|domain|secure)$/i
Better/^(?:expires|max-age|path|domain|secure)$/I
For example
/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g
Better/((?:^|\s*;)[^=]+)(?=;|$)|^\s*|\s*(?:=[^;]*)?(?:\1|$)/g