Description
This issue was originally created at: 2010-02-04 08:32:16.
This issue was reported by: gerard_
.
gerard_ said at 2010-02-04 08:32:16
This patch (a new regexp) solves two problems:
- It allows for custom resource types (like XAML). (this is an enhancement)
- It does match when there are \r\n line endings (this is a bugfix)
gerard_ said at 2010-02-04 08:32:46
Created an attachment (id=686)
Regexp for RCScan
gerard_ said at 2010-02-04 10:03:36
Set type to PATCH
gregnoel said at 2010-02-19 11:14:09
Bug party triage. Steven to get advice from the .rc expert at his day job.
stevenknight said at 2010-02-22 15:58:37
I'm studying this issue, and wanted to capture an update with links to the
relevant MSDN spec pages for user-defined resources:http://msdn.microsoft.com/en-us/library/aa380599(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa381043(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa381054(VS.85).aspxThere are two key questions:
the new regex is more expansive in matching any user-defined resource, and
it's not clear whether we'd get false positives on lines that match two keywords
followed by a quoted string that isn't a file name.the old regex would match non-quoted file names following the specific
keywords involved, while the new regex requires quotes. The spec pages I
looked at don't indicate whether a file name must be quoted. If they can be
left un-quoted, then we need to preserve the ability to match those.
gregnoel said at 2010-07-21 17:00:30
Bug party triage. Bump the priority of this issue.
gerard_ said at 2011-08-17 01:52:18
Steven, thanks for the links, on your questions:
- The specification is indeed very broad. I think it's this:
r'^\s*'+ # leading whitespace
r'(?:\w+\s+\w+)'+ # BLAH BLAH
r'\s+("[\w./\]+"|[\w./\]+)\s*$' # ..\file_haha.test or "file.test"
(only for resources, not #includes, not tested)
It would be much better to have two separate regexes instead of the one that
tries to match both the resource and the #include.If we want to prevent false positives it should check if it is a valid resource
type, and allow the user to provide user defined types.
- I agree, it's a messy specification. See the regex from 1.
gerard_ attached RCScanner.patch at 2010-02-04 08:32:46.
Regexp for RCScan
Activity