Skip to content

Commit dbeffe0

Browse files
committed
chore: liberal regex
1 parent 93b40a8 commit dbeffe0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/mongodb-redact/src/regexes.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ export const regexes = [
2727
'$1<email>$6',
2828
],
2929

30-
// MongoDB connection strings (before IP addresses to handle mongodb://IP:port URIs)
31-
[
32-
/(mongodb(?:\+srv)?:\/\/)(www\.)?(?:[^:/@\s]+:[^@\s]*@)?[-a-zA-Z0-9@:%._+~#=,]{2,256}(\.[a-z]{2,6})?\b([-a-zA-Z0-9@:%_+.~#?&/=]*)/gim,
33-
'<mongodb uri>',
34-
],
30+
// MongoDB connection strings
31+
[/mongodb(?:\+srv)?:\/\/\S+/gim, '<mongodb uri>'],
3532

3633
// IP addresses
3734
[

0 commit comments

Comments
 (0)