JavaScript Algorithms and Data Structures Projects - Palindrome Checker

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**
function palindrome(str) {
str = /(?=\s+)/ig;
return true;
}
console.log(palindrome("eye"))
palindrome("eye");
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36

Challenge: JavaScript Algorithms and Data Structures Projects - Palindrome Checker

Link to the challenge:

Do you have a question? All this does is reassign the parameter and return true.

am having problem on the [How to check that a string is a palindrome using regular expressions

Yes. But what about it is confusing you?

Regex is complicated. There is a lot to regex. We need more information to be able to discuss your particular confusion.

I would say that this is a complicated problem to solve with regex. I’m not even sure how it can be done with only regex.

Have you solved it without regex? I’m not sure if there is the best fit here. The exception would be the first step, normalizing the string. But for the actual palindrome check, I think there are better approaches.

1 Like