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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 4
Title Test Details 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
Title Test Details SQL Server Connection String
Expression
(?:(?:Data Source)|(?:Server))=([\w\.]+?);\s*?(?:(?:Initial Catalog)|(?:Database))=(\w+?);\s*?(?:(?:User Id)|(?:Uid))=(\w+?);\s*?(?:(?:Password)|(?:Pwd))=(\w*?);.*
Description
Matches an SQL Server 2008 Connection String
Matches
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; | Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;
Non-Matches
Anything else
Author Rating: Not yet rated. HJennerway
Title Test Details CSS Url
Expression
url\(['"]?([\w\d_\-\. ]+)['"]?\)
Description
Matches a CSS Background tag. I needed this to replace image links in CSS with data-URI encoded strings.
Matches
background: url("pattern.jpg"); | background: url("yellowcard-bg.png") no-repeat scroll right top #FFFF9E; | color: #607890;
Non-Matches
margin-left: 2em; | list-style-type: decimal;
Author Rating: Not yet rated. HJennerway
Title Test Details Timespan
Expression
(\d+(?:\s+d(?:ay)?s?))?\s?(\d+(?:\s+h(?:ou)?r?s?))?\s?(\d+(?:\s+m(?:in)?(?:ute)?s?))?\s?(\d+(?:\s+s(?:ec)?(?:ond)?)?s?)?$
Description
Used for matching fuzzy timespans given in days, hours minutes, seconds and any combination thereof.
Matches
6 days 18 hrs 2 mins | 4 days 19 hrs 5 mins | 4 days 19 hrs 12 mins | 2 h 20 mins | 1 hr 20 mins | 1 hour | 12 m | 12 minutes 15 seconds | 12 mins 15 secs | 1 min | 1 mins 10 seconds | 1 min 35 secs | 1 m | 1 m 10 s | 1 m 35 secs | 24 seconds | 25 secs | 1 sec | 1 s | 1 secs
Non-Matches
7 apples 2 pears | 1 banana 2 banana | 3 banana 4 | 5 banana 6 banana 7 banana more
Author Rating: The rating for this expression. HJennerway
   Displaying page 1 of 1 pages; Items 1 to 4

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