corinthia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriela Gibson <gabriela.gib...@gmail.com>
Subject Using regex.h?
Date Mon, 11 May 2015 18:07:16 GMT
In my gbg_test.c file, I have produced the following monstrosity:

Tag text_h(DFNode *node)
{
    char *s = node->attrs->value;
    if ((int)s[11] > 55 || strlen(s) == 13)
        return HTML_H6;
    else
        return HTML_H1 + (int)s[11] - 49;
}

Because I will need to make more such things to match the attribute
values, I'm wondering if we could use regex.h instead, or if that is
too unix specific and not available on other platforms.

G
-- 
Visit my Coding Diary: http://gabriela-gibson.blogspot.com/

Mime
View raw message