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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
((\s)*(?<Key>([^\=^\s^\n]+))[\s^\n]* # key part (surrounding whitespace stripped) \= (\s)*(?<Value>([^\n^\s]+(\n){0,1}))) # value part (surrounding whitespace stripped)
Description
Regular expression to fetch <key-value> pairs from the old-fashioned .ini files. Key and Value appears in form of named captures with whitespaces stripped on both ends.
Matches
webProxyPort=8080 | webProxyPort = 8080 | webProxyPort = 8080
Non-Matches
abcdefghijk
Author Rating: Not yet rated. Alexander Pinsker
Source http://alexpinsker.blogspot.com/2005/12/regular-expression-to-parse-ini-files.html
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

Title: How to deal comment
Name: exatex
Date: 8/2/2011 11:26:48 AM
Comment:
Suppose: Key1 = Value1 ; My comment Key = Key1 Value = Value1 Comment = Comment Other issue: Key1 = "Value1;value2) Key = Key1 Value = "Value1;Value2" Comment =


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