[CMake] CMake regexes: Case insensitive and whitespace matching

Daniel Lueken Daniel.Lueken at bmw-carit.de
Mon May 8 09:19:56 EDT 2017


Hi!

Is there any way to do case insensitive matching in string(REGEX ... ?
Also, is there a way to match whitespaces?

What I would like to do, speaking in Perl-like syntax, is something like

string(REGEX REPLACE "/something\s+/stuff/i" ...

Not knowing how to do this, I am currently doing something along the lines of

string(REGEX REPLACE "[Ss][Oo][Mm][Ee][Tt][Hh][Ii][Nn][Gg][\\r\\n\\t ]+" ...

which looks pretty wrong to me. Converting everything to upper or lower case is also not an option since parts of the input string in which I need to replace something are case sensitive.

Best regards
Daniel Lueken

--
BMW Car IT GmbH
Daniel Lüken
Spezialist Entwicklung
Moosacher Straße 86
80809 München

Tel.: ­+49-89-189311-35
Fax: +49-89-189311-20
Mail: daniel.lueken at bmw-carit.de<mailto:daniel.lueken at bmw-carit.de>
Web: http://www.bmw-carit.de<http://www.bmw-carit.de/>
-------------------------------------------------------------------------
BMW Car IT GmbH
Geschäftsführer: Kai-Uwe Balszuweit und Alexis Trolin
Sitz und Registergericht: München HRB 134810
-------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170508/551d7388/attachment.html>


More information about the CMake mailing list