MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0005999 | CMake | CMake | public | 2007-11-02 17:55 | 2016-06-10 14:30 |
Reporter | Brandon Van Every | ||||
Assigned To | Bill Hoffman | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0005999: REGEX ^ does not anchor against the original string | ||||
Description | ^ doesn't anchor against the original input string. It anchors against the string as it is processed! If replacements cause the string to have a new beginning, it anchors against the new beginning. Perl does not exhibit this behavior. I know CMake is not Perl, but Perl is a good baseline for "sanity" in regex processing. If a ^ anchor isn't respected then it renders the use of such an anchor fairly pointless. Reproducer script anchor.cmake: SET(sillystring "I wanna rock!") MESSAGE("original string:") MESSAGE("${sillystring}") MESSAGE("expecting replacement to remove the leading 'I'. Instead we get:") STRING(REGEX REPLACE "^." "" out "${sillystring}") MESSAGE("${out}") C:\devel\src\cbugs\anchor>cmake -P anchor.cmake original string: I wanna rock! expecting replacement to remove the leading 'I'. Instead we get: C:\devel\src\cbugs\anchor> For comparison, a Perl script anchor.pl: my $sillystring; $sillystring = "I wanna rock!\n"; print "Original string:\n"; print $sillystring; print "Expecting replacement to remove the leading 'I'. In Perl we get:\n"; $sillystring =~ s/^.//; print $sillystring; bvanevery@OLDFAITHFUL /c/devel/moz $ perl anchor.pl Original string: I wanna rock! Expecting replacement to remove the leading 'I'. In Perl we get: wanna rock! bvanevery@OLDFAITHFUL /c/devel/moz $ | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2007-11-02 17:55 | Brandon Van Every | New Issue | |||
2007-11-02 17:59 | Brandon Van Every | Description Updated | |||
2007-11-03 16:27 | Brandon Van Every | Note Added: 0009626 | |||
2007-12-14 20:49 | Bill Hoffman | Status | new => assigned | ||
2007-12-14 20:49 | Bill Hoffman | Assigned To | => Bill Hoffman | ||
2016-06-10 14:27 | Kitware Robot | Note Added: 0041401 | |||
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 | |||||
|
|||||
|
|
||||
|
|||||
|
|