69 unsigned int char_op_switch;
70 unsigned int last_was_op;
77 if (NULL != matching_str)
78 matching_strp = matching_str;
87 for (i = 0; i < rx_length; i++)
91 if ((0 == char_op_switch) && ! last_was_op)
111 if (i < rx_length - 1)
124 if ((NULL != matching_strp) &&
125 ((current_char !=
'+') && (current_char !=
'*') && (current_char !=
127 (current_char !=
'|') ))
129 *matching_strp = current_char;
133 *rx_p = current_char;
137 if (NULL != matching_strp)
138 *matching_strp =
'\0';
166 for (i = 0; i < len; i++)
uint32_t GNUNET_CRYPTO_random_u32(uint32_t i)
Produce a random value.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define ALLOWED_LITERALS
char array of literals that are allowed inside a regex (apart from the operators)
static char get_random_literal()
Get a (pseudo) random valid literal for building a regular expression.
char * REGEX_TEST_generate_random_regex(size_t rx_length, char *matching_str)
Generate a (pseudo) random regular expression of length 'rx_length', as well as a (optional) string t...
char * REGEX_TEST_generate_random_string(size_t max_len)
Generate a random string of maximum length 'max_len' that only contains literals allowed in a regular...