<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - libc++ does not correctly handle the regex: "[^\\W]"
   href="https://bugs.llvm.org/show_bug.cgi?id=34310">34310</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>libc++ does not correctly handle the regex: "[^\\W]
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alex.semenov@samsung.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I find bug in libc++ in regex. This is my code sample:

#include <iostream>
#include <regex>
#include <string>

int main() {

    std::string HW("HelloWorld");
    std::regex RE("[^\\W]");

    if (std::regex_search(HW, RE))
        std::cout << "regexp is OK";
    else
        std::cout << "regexp is broken";

    std::cout << std::endl;
    return 0;
}

This is my command for compilation:
clang++ -std=c++11 -stdlib=libc++ main.cpp

And I get:
regexp is broken

But, if I use libstdc++ :

clang++ -std=c++11 -stdlib=libstdc++ main.cpp

It's ok:
regexp is OK

I get bug only for regexp [^\\W] and for combinations with it.

I use libc++dev form ubuntu version: 3.9.1-2</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>