[CMake] string replace first occurrence of a period using regex

Mikael Sundell mikael.sundell at gmail.com
Sun Dec 16 06:13:52 EST 2012


Thanks!

On Sat, Dec 15, 2012 at 1:33 PM, Rolf Eike Beer <eike at sf-mail.de> wrote:

> Mikael Sundell wrote:
> > First, thanks for cmake!
> > In cmake, how can I easily replace the first period "." in a string with
> a
> > substitute using regex and string replace?
> > For example:
> >   z
> >   z.1
> >   z.1.2.5
> > With replacement ".so", "." becomes ".so" as in:
> >   z.so
> >   z.so.1
> >   z.so.1.2.5
> > My regex is improving but not fast enough :)
> > Thanks,
> > Mikael
>
> "^([^.]*)\.(.*)" "\\1.so.\2"
>
> Eike
> --
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121216/5bb104bf/attachment.htm>


More information about the CMake mailing list