MCPcopy Create free account
hub / github.com/boostorg/build / regex_split

Function regex_split

v2/engine/modules/regex.c:34–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32*/
33
34LIST * regex_split( FRAME * frame, int flags )
35{
36 LIST * args = lol_get( frame->args, 0 );
37 OBJECT * s;
38 OBJECT * separator;
39 regexp * re;
40 const char * pos;
41 LIST * result = L0;
42 LISTITER iter = list_begin( args );
43 s = list_item( iter );
44 separator = list_item( list_next( iter ) );
45
46 re = regex_compile( separator );
47
48 pos = object_str( s );
49 while ( regexec( re, pos ) )
50 {
51 result = list_push_back( result, object_new_range( pos, re->startp[ 0 ] - pos ) );
52 pos = re->endp[ 0 ];
53 }
54
55 result = list_push_back( result, object_new( pos ) );
56
57 return result;
58}
59
60/*
61rule replace (

Callers

nothing calls this directly

Calls 8

lol_getFunction · 0.85
list_beginFunction · 0.85
regex_compileFunction · 0.85
object_strFunction · 0.85
regexecFunction · 0.85
list_push_backFunction · 0.85
object_new_rangeFunction · 0.85
object_newFunction · 0.85

Tested by

no test coverage detected