Regex replace help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
/usr/share/cmake/Modules and don't see what I'm doing that's so
different.

The relevant lines in /usr/include/tinyxml.h are:

const int TIXML_MAJOR_VERSION = 2;
const int TIXML_MINOR_VERSION = 6;
const int TIXML_PATCH_VERSION = 1;

To speed up the testing I'm trying to come up with a sed equivalent to
make sure it's returning the version numbers properly.

Here's what I have:
$ echo "const int TIXML_MAJOR_VERSION = 2;" | sed 's/const int
TIXML_MAJOR_VERSION = \([0-9]+\).*/\1/'
const int TIXML_MAJOR_VERSION = 2;

The "echo" is one of the lines I'm trying to match while only
returning the version number. For some reason I'm getting the whole
line back...

Can anyone give me a hint before I pull all my hair out?

Thanks,
Richard
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux