Regular expression to fetch <key-value> pairs from the old-fashioned .ini files:
((\s)*(?<Key>([^\=^\s^\n]+))[\s^\n]* # key part (surrounding whitespace stripped) \= (\s)*(?<Value>([^\n^\s]+(\n){0,1}))) # value part (surrounding whitespace stripped)
|
Would fetch patterns in form of:
webProxyPort=8080 |
webProxyPort = 8080 |
webProxyPort = 8080 |
Key and Value appears in form of named captures with whitespaces stripped on both ends.
|
2 comments:
P.S.
published at RegExLib:
http://www.regexlib.com/REDetails.aspx?regexp_id=1269
Can't seem to get it to work?
Post a Comment