diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-07-30 01:47:12 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-07-30 01:47:12 +0000 |
| commit | 90edb3a743ab4e9fc18ff18844cc3624433cd3fc (patch) | |
| tree | 089c3b986a00f7a014d6f30a10a9dbb049551e3b /src/util/units.cpp | |
| parent | Removed SPMetric. (diff) | |
| download | inkscape-90edb3a743ab4e9fc18ff18844cc3624433cd3fc.tar.gz inkscape-90edb3a743ab4e9fc18ff18844cc3624433cd3fc.zip | |
Update unit extraction regular expressions.
(bzr r12380.1.50)
Diffstat (limited to 'src/util/units.cpp')
| -rw-r--r-- | src/util/units.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/units.cpp b/src/util/units.cpp index 582c52090..342c9ff32 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -228,14 +228,14 @@ Quantity UnitTable::getQuantity(Glib::ustring const& q) const // Extract value double value = 0; - Glib::RefPtr<Glib::Regex> value_regex = Glib::Regex::create("\\d+\\.?\\d"); + Glib::RefPtr<Glib::Regex> value_regex = Glib::Regex::create("[-+]*[\\d+]*\\.*[\\d+]*[eE]*[-+]*\\d+"); if (value_regex->match(q, match_info)) { value = atof(match_info.fetch(0).c_str()); } // Extract unit abbreviation Glib::ustring abbr; - Glib::RefPtr<Glib::Regex> unit_regex = Glib::Regex::create("[A-z]+"); + Glib::RefPtr<Glib::Regex> unit_regex = Glib::Regex::create("[A-z%]+"); if (unit_regex->match(q, match_info)) { abbr = match_info.fetch(0); } |
