spicy icon indicating copy to clipboard operation
spicy copied to clipboard

:word: character class could be supported in regex

Open duffy-ocraven opened this issue 4 years ago • 0 comments

:word: character class could be supported in regex. I see these five in parallel:

jrx_ccl* local_ccl_lower(jrx_ccl_group* group)
{
    jrx_ccl* ccl = ccl_empty(group);
    ccl = _add_range(ccl, 'a', 'z');
    return ccl;
}

jrx_ccl* local_ccl_upper(jrx_ccl_group* group)
{
    jrx_ccl* ccl = ccl_empty(group);
    ccl = _add_range(ccl, 'A', 'Z');
    return ccl;
}

jrx_ccl* local_ccl_word(jrx_ccl_group* group)
{
    jrx_ccl* ccl = ccl_empty(group);
    ccl = _add_range(ccl, 'a', 'z');
    ccl = _add_range(ccl, 'A', 'Z');
    ccl = _add_range(ccl, '0', '9');
    ccl = _add_range(ccl, '_', '_');
    return ccl;
}

jrx_ccl* local_ccl_digit(jrx_ccl_group* group)
{
    jrx_ccl* ccl = ccl_empty(group);
    ccl = _add_range(ccl, '0', '9');
    return ccl;
}

jrx_ccl* local_ccl_blank(jrx_ccl_group* group)
{
    jrx_ccl* ccl = ccl_empty(group);
    ccl = _add_range(ccl, ' ', ' ');
    ccl = _add_range(ccl, '\t', '\t');
    return ccl;

in 3rdparty/justrx/include/justrx/jlocale.h which has these five things in parallel. But per comment at https://github.com/zeek/spicy/commit/94be65c1ad13dc1f88f0e9159439d85477ed1868#commitcomment-45383608 of those five, :word: is not carried up to character-class support.

duffy-ocraven avatar Dec 29 '20 20:12 duffy-ocraven