RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find MySQL Connection String
Expression
Server=([\w\.]+?);\s*?(?:Port=(\d+?);\s*?)?Database=(\w+?);\s*?(?:(?:User)|(?:Uid))=(\w+?);\s*?(?:(?:Password)|(?:Pwd))=(\w*?);.*
Description
Matches a MySQL connection string if the arguments are in the specified order. Fails if arguments are missing.
Matches
Server=127.0.0.1;Port=3306;Database=test;User=echilon;Password=P@55word;charset=utf8 | Server=pegasus;Port=3306;Database=test;Uid=johnnytightlips;Pwd=whosaskin;
Non-Matches
Server=127.0.0.1;User=echilon;Password=none;charset=utf8
Author Rating: Not yet rated. HJennerway
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials