Skip to content

Commit f99e90d

Browse files
committed
fix: add missing characters to regex
1 parent 486919c commit f99e90d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/interview-classics/is-palindrome/is-palindrome-method.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Characters to remove from string in order to normalize it
2-
const charsToRemove = /[.,:;?!\s]/g
2+
const charsToRemove = /[-.,:;?!'"\s()]/g
33

44
/**
55
* Checks if a string is a palindrome. Uses srtring and array methods.

src/interview-classics/is-palindrome/is-palindrome-while.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Characters to remove from string in order to normalize it
2-
const charsToIgnore = /[.,:;?!\s]/
2+
const charsToIgnore = /[-.,:;?!'"\s()]/
33

44
/**
55
* Checks if a string is a palindrome. Uses a while loop.

0 commit comments

Comments
 (0)