• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
CEP18 Avatar
Name:Unknown
Clan:Unknown
Member Since:Sep 2022
Last Seen:Jun 2025
Profiles:
Following:0
Followers:0
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (13)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • rsschool_91627c1aa67bbc66
    • resolved a question on "Duplicate Encoder" kata
    • 3 years ago

    ok, thank you mate, i'll do it another way.

  • Custom User Avatar
    • hobovsky
    • commented on "Duplicate Encoder" kata
    • 3 years ago

    You cannot treat any arbitrary input as a regular expression, because this way you can create malformed regex.
    For example, if the input is "(" and you want to turn it into a regex in a naive way, you end up with regular expression of /(/g, which is not a valid regex pattern.

    This task does not even need regex, regex based slution for this task is probably more complicated than even necessary.

  • Custom User Avatar
    • rsschool_91627c1aa67bbc66
    • created a question for "Duplicate Encoder" kata
    • 3 years ago

    hey guys. i am solving with js, and when i want to add ")" to string, it raises an error SyntaxError: Invalid regular expression. It works OK with letters, but not with "(" or ")". can anyone help?

  • Custom User Avatar
    • CEP18
    • commented on "Duplicate Encoder" kata
    • 3 years ago

    Thanks for the reply!

  • Custom User Avatar
    • hobovsky
    • commented on "Duplicate Encoder" kata
    • 3 years ago

    That's because your solution has a bug. It does not work for a following test case either: assert.strictEqual(duplicateEncode("aA"),"))");

  • Custom User Avatar
    • CEP18
    • commented on "Duplicate Encoder" kata
    • 3 years ago

    Hi!

    It works in my IDE but not here. The only test that fail is: "Supralapsarian"

  • Custom User Avatar
    • Chrono79
    • commented on "Replace With Alphabet Position" kata
    • 3 years ago

    https://www.codewars.com/kata/546f922b54af40e1e90001da/discuss#632895c124dbb526e9c5af49

  • Custom User Avatar
    • arkadiusz-szkurlat-wttech
    • commented on "Replace With Alphabet Position" kata
    • 3 years ago

    In IDE works fine, but in codewars replaceAll is not a function :/

  • Custom User Avatar
    • Chrono79
    • commented on "Replace With Alphabet Position" kata
    • 3 years ago

    Read this: https://docs.codewars.com/training/troubleshooting#.print-vs-return

    Please mark your post as having spoiler content next time and use markdown formatting, see how to post your code in the docs too.

  • Custom User Avatar
    • ivanIStereotekk
    • commented on "Replace With Alphabet Position" kata
    • 3 years ago

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    • CEP18
    • commented on "Replace With Alphabet Position" kata
    • 3 years ago

    Thank you a lot for the reply

  • Custom User Avatar
    • Chrono79
    • commented on "Replace With Alphabet Position" kata
    • 3 years ago

    The error message is this:

    TypeError: text.toLowerCase(...).replaceAll is not a function
    

    And that's because replaceAll requires Node v15 or higher: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll#browser_compatibility

  • Custom User Avatar
    • CEP18
    • commented on "Replace With Alphabet Position" kata
    • 3 years ago

    Hi!
    My solution works in my ide, but not here.
    throw this "TypeError: .......... is not a function"

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...