Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • First, that regex isn't totally reliable, or efficient. The (capturing group) is unnecessary. You should use (?: |^)c'+i+'(?: |$). Second, this is far from the fastest. jsben.ch/QAOQs Commented Jun 15, 2021 at 23:18
  • @RegularJo I run your test, but it results to me that regex is the fastest Commented Jun 16, 2021 at 7:38
  • @RegularJo also the "c" in your regex is wrong, the correct regex is '(?: |^)'+i+'(?: |$)' Commented Jun 16, 2021 at 7:57
  • Lol, yep, forgot to update my regex from the test to change the c back. Commented Jun 16, 2021 at 10:57