Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
^mongodb:\/\/[^\/\,]+:{1}[^\/\,]*@{1}.*$
/
mg

Description

Test if a mongo db connection string has a username and password declared in it. Doesn't work with with multi host ATM

Submitted by Gecko Pico - 4 years ago