G
Guest
Hi,
I'm having a problem with a regex spanning multiple lines. It returns all
matches in a single one, instead of multiple matches. The code I'm using is
this:
Regex regex = new Regex(@"^<Location /[A-Za-z0-9/_-]+>[\s\S]+^</Location>",
RegexOptions.Multiline);
And the input text is this:
<Location /oceans/pacific>
DAV svn
SVNParentPath c:\repositories\pacific
AuthType Digest
AuthName "Pacific Ocean"
AuthDigestFile admin/svn-users
AuthDigestDomain /oceans
AuthzSVNAccessFile admin/svn-policy
Require valid-user
</Location>
<Location /oceans/atlantic>
DAV svn
SVNParentPath c:\repositories\atlantic
AuthType Digest
AuthName "Atlantic Ocean"
AuthDigestFile admin/svn-users
AuthDigestDomain /oceans
AuthzSVNAccessFile admin/svn-policy
Require valid-user
</Location>
It should return two matches. However, it returns only one match containing
all the text between the first occurrence of <Location through the last
occurrence of </Location>.
What am I missing here?
Thanks,
Celio Cidral Junior
I'm having a problem with a regex spanning multiple lines. It returns all
matches in a single one, instead of multiple matches. The code I'm using is
this:
Regex regex = new Regex(@"^<Location /[A-Za-z0-9/_-]+>[\s\S]+^</Location>",
RegexOptions.Multiline);
And the input text is this:
<Location /oceans/pacific>
DAV svn
SVNParentPath c:\repositories\pacific
AuthType Digest
AuthName "Pacific Ocean"
AuthDigestFile admin/svn-users
AuthDigestDomain /oceans
AuthzSVNAccessFile admin/svn-policy
Require valid-user
</Location>
<Location /oceans/atlantic>
DAV svn
SVNParentPath c:\repositories\atlantic
AuthType Digest
AuthName "Atlantic Ocean"
AuthDigestFile admin/svn-users
AuthDigestDomain /oceans
AuthzSVNAccessFile admin/svn-policy
Require valid-user
</Location>
It should return two matches. However, it returns only one match containing
all the text between the first occurrence of <Location through the last
occurrence of </Location>.
What am I missing here?
Thanks,
Celio Cidral Junior