Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,807
    • Issues 3,807
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #16980

Closed
Open
Created Jun 15, 2017 by shadow_walker@shadowwalkersb

Regex with `*` behaves unexpectedly

When I check if regex "Darwin-12*" matches "Darwin-15.0.0", the result is True. I would expect the result to be False. Sorry, if I am missing something very obvious.

CMakeLists.txt

set(str Darwin-15.0.0)

if(str MATCHES "Darwin-12*")
	message("${str} matches Darwin-12*")
else()
	message("${str} DOES NOT match Darwin-12*")
endif()
$ cmake .
Darwin-15.0.0 matches Darwin-12*
-- Configuring done
-- Generating done
-- Build files have been written to: <REDACTED>
$ cmake --version
cmake version 3.6.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Edited Jun 15, 2017 by shadow_walker
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking