Skip to content

Commit 4bbb9f3

Browse files
authored
update regex by avoid matching more open brackets
update regex to avoid matching more open brackets from @ichernev suggestion
1 parent bfd4f23 commit 4bbb9f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/create/from-string.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function untruncateYear(yearStr) {
151151
function preprocessRFC2822(s) {
152152
// Remove comments and folding whitespace and replace multiple-spaces with a single space
153153
return s
154-
.replace(/\((?:(?!\().)*\)|[\n\t]/gs, ' ')
154+
.replace(/\([^()]*\)|[\n\t]/g, ' ')
155155
.replace(/(\s\s+)/g, ' ')
156156
.replace(/^\s\s*/, '')
157157
.replace(/\s\s*$/, '');

0 commit comments

Comments
 (0)