Re: Regex replace help

2011-12-04 Thread Ville Skyttä
On 12/04/2011 04:00 AM, Miloslav Trmač wrote: On Sun, Dec 4, 2011 at 12:07 AM, Richard Shaw hobbes1...@gmail.com wrote: $ echo const int TIXML_MAJOR_VERSION = 2; | sed 's/const int TIXML_MAJOR_VERSION = \([0-9]+\).*/\1/' const int TIXML_MAJOR_VERSION = 2; By replacing (sed 's/../../') with

Re: Regex replace help

2011-12-04 Thread Haïkel Guémar
Le 04/12/2011 00:07, Richard Shaw a écrit : I'm writing my own cmake module for finding TinyXML and I'm trying to extract the version from the header. For some reason it's matching the whole file no matter what I do. I've looked through several of the cmake modules in

Re: Regex replace help

2011-12-04 Thread Richard Shaw
2011/12/3 Miloslav Trmač m...@volny.cz: On Sun, Dec 4, 2011 at 12:07 AM, Richard Shaw hobbes1...@gmail.com wrote: $ echo const int TIXML_MAJOR_VERSION = 2; | sed 's/const int TIXML_MAJOR_VERSION = \([0-9]+\).*/\1/' const int TIXML_MAJOR_VERSION = 2; By replacing (sed 's/../../') with (sed -n

Re: Regex replace help

2011-12-04 Thread Denis Arnaud
Hi Richard, Date: Sat, 3 Dec 2011 17:07:37 -0600 From: Richard Shaw hobbes1...@gmail.com Subject: Regex replace help To: Development discussions related to Fedora devel@lists.fedoraproject.org Message-ID: CAN3TeO0JbsJQYaXvJnxFkrYVtF=mla-gcse2yic+jx3wfud...@mail.gmail.com

Re: Regex replace help

2011-12-04 Thread Haïkel Guémar
Le dim. 04 déc. 2011 15:01:16 CET, Richard Shaw a écrit : I think I see what you're doing here, but shouldn't a direct replace work? Thanks, Richard AFAIK, CMake does not have multi-line regex, so it doesn't work. If you find a better trick, please share it :-] H. -- devel mailing list

Re: Regex replace help

2011-12-04 Thread Richard Shaw
On Sun, Dec 4, 2011 at 9:20 AM, Haïkel Guémar karlthe...@gmail.com wrote: AFAIK, CMake does not have multi-line regex, so it doesn't work. If you find a better trick, please share it :-] Denis's email client replied to the list and me and I didn't catch that gmail only replied to him directly

Re: Regex replace help

2011-12-03 Thread Miloslav Trmač
On Sun, Dec 4, 2011 at 12:07 AM, Richard Shaw hobbes1...@gmail.com wrote: $ echo const int TIXML_MAJOR_VERSION = 2; | sed 's/const int TIXML_MAJOR_VERSION = \([0-9]+\).*/\1/' const int TIXML_MAJOR_VERSION = 2; By replacing (sed 's/../../') with (sed -n 's/../../p') you can see that the regex