By the way, are you asking this because of some LLDB code? If so, I would rather standardize on std::regex. Consistent rules across all platforms, and supported everywhere AFAIK.<br><br><div class="gmail_quote">On Tue Jan 20 2015 at 3:41:20 PM Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The code below fails to match the string "a" to the regex "^a$" on MacOSX if both "REG_EXTENDED | REG_ENHANCED" are specified, but it will pass if just REG_ENHANCED is used.<br>
<br>
Can someone run this on linux to see if the code below fails as well on linux? I want to make sure it isn't just an old version of regex we have in our libc...<br>
<br>
<br>
<br>
#include <stdio.h><br>
#include <stdint.h><br>
#include <regex.h><br>
<br>
#define DEFAULT_REG_FLAGS (REG_EXTENDED | REG_ENHANCED)<br>
<br>
int main (int argc, char const *argv[], char const *envp[])<br>
{<br>
regex_t re;<br>
const char *regex_input = "a";<br>
int err = regcomp (&re, "^a$", DEFAULT_REG_FLAGS);<br>
if (err == 0)<br>
{<br>
err = regexec (&re, regex_input, 0, NULL, DEFAULT_REG_FLAGS);<br>
if (err == 0)<br>
{<br>
puts("matched");<br>
}<br>
else<br>
{<br>
char error_str[2048];<br>
const size_t actual_error_str_size = regerror(err, &re, error_str, sizeof(error_str));<br>
puts(error_str);<br>
}<br>
}<br>
return 0;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-dev</a><br>
</blockquote></div>