MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0005380 | CMake | Documentation | public | 2007-07-20 20:53 | 2016-06-10 14:30 |
Reporter | Brandon Van Every | ||||
Assigned To | Bill Hoffman | ||||
Priority | normal | Severity | text | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0005380: REGEX ^ and $ do not match on multi-line <input> | ||||
Description | # ^ and $ appear to be non-functional in practice. This makes it # impossible to code a non-trivial regex in CMake script. This in turn # forces the user to find or install other tools that can do so, rather # than keeping their scripting logic self-contained in CMake. # # ^ and $ work work with respect to an entire <input> to STRING(). # That is to say, an <input> is treated as one line. The <input> # does not preserve newlines, even if it is read from a multi-line file. # The following code snippet demonstrates that ^ and $ will only # match at the beginning and end of a file, when the file is read in as # an <input> string. FILE(WRITE in.txt "line0 line1 line2") FILE(READ in.txt stream) STRING(REGEX MATCH "^line0" line0_start "${stream}") STRING(REGEX MATCH "line0$" line0_end "${stream}") STRING(REGEX MATCH "^line1" line1_start "${stream}") STRING(REGEX MATCH "line1$" line1_end "${stream}") STRING(REGEX MATCH "^line2" line2_start "${stream}") STRING(REGEX MATCH "line2$" line2_end "${stream}") MESSAGE("${line0_start}") MESSAGE("${line0_end}") MESSAGE("${line1_start}") MESSAGE("${line1_end}") MESSAGE("${line2_start}") MESSAGE("${line2_end}") #Output: only line0_start and line2_end match. # #C:\in\cbugs>cmake -P regex.cmake #line0 # # # # #line2 # #C:\in\cbugs> | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2007-11-23 13:39 | Brandon Van Every | Note Added: 0009733 | |||
2007-11-23 13:39 | Brandon Van Every | Severity | major => text | ||
2007-11-23 13:49 | Brandon Van Every | Category | CMake => Documentation | ||
2016-06-10 14:27 | Kitware Robot | Note Added: 0041377 | |||
2016-06-10 14:27 | Kitware Robot | Status | assigned => resolved | ||
2016-06-10 14:27 | Kitware Robot | Resolution | open => moved | ||
2016-06-10 14:30 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|