summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-12-11 15:33:37 -0500
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-12-11 15:33:37 -0500
commit80cf1f9fc280652ec523bd8dda1092db48e6e327 (patch)
tree839d1b33410b3b660063c9b64b7e56f310a6c28c /parser.c
parent36f205a1008698be54ded3b6bb31b49a1bcec981 (diff)
added conditional_regex_replace utility function
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/parser.c b/parser.c
index 65729a4..0f12f54 100644
--- a/parser.c
+++ b/parser.c
@@ -588,12 +588,10 @@ static int Parser_get_unit(char **parameter, char **units)
static gchar* regex_replace (gchar* in_string, gchar* regex_string, gchar* replace_with)
{
- GRegex *regex = g_regex_new (regex_string, 0, 0, NULL);
- gchar *out = g_regex_replace_literal (regex, in_string, -1, 0, replace_with, 0, NULL);
- g_regex_unref (regex);
- return out;
+ return conditional_regex_replace (TRUE, in_string, regex_string, replace_with);
}
+
static gchar* filter_input (gchar *raw_in)
{
g_strstrip (raw_in);