[libcxx-commits] [PATCH] D66610: [libc++] ECMAScript IdentityEscape is ambiguous (2584)

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 7 13:35:41 PDT 2020


ldionne accepted this revision.
ldionne added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp:1401
+
+        // const std::regex r3("\\zz");
+        // assert(std::regex_match("zzz", r3));
----------------
zoecarver wrote:
> ldionne wrote:
> > Why are those tests commented out?
> I wasn't sure if they should also work (they currently don't because, while the first part is matched, it fails when it sees the extra `z`). Looking at it again I think that's the correct behavior (not to match). 
> 
> I'm going to remove it from this patch. If it is supposed to work, I think that's a different issue than the one addressed here.
I think `regex("\\z")` clearly should NOT match `"zz"`. Basically, `regex("\\z")` is just equivalent to `regex("z")`, so whether `regex("\\z")` should match `"zz"` is the same as whether `regex("z")` should match `"zz"` (the answer is no).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66610/new/

https://reviews.llvm.org/D66610





More information about the libcxx-commits mailing list