Quantcast
Channel: CodeProject Latest postings for Regular Expressions
Viewing all articles
Browse latest Browse all 224

Correct Expression For 'Any Character Including Whitespace'

$
0
0
Hi all,

I've been fighting with this for hours now, but don't get it to work. I want to strip out some information from an ini-file, which basically looks like this:
[CameraDefinition.1]
Title=Linke Seite
Guid={0ae3f864-da10-4e5a-977c-b9bba47d6f7a}
Description=Ansicht nach links
Origin=Center
It's a standard Windows text file, the sections are separated with two new lines (\r\n\r\n). My regex currently looks like this: "\[CameraDefinition\.(?<camnumber>\d+)\][.|\s]*Guid=(?<guid>\{[0-9A-F\-]*\})"

While the first (CamNumber) and the last part (Guid) return correct results as 'partial match', the critical part seems to be the underlined expression for "everything between the top and the Guid", which might be several lines.

I'd be happy if someone of you helps me solve this... Thank you in advance!
Regards
Mick

Viewing all articles
Browse latest Browse all 224

Trending Articles