Home >Backend Development >PHP Tutorial >Questions about regularity

Questions about regularity

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-09-23 03:30:071013browse
<code>       function palindrome(str) {
         return str.replace(/[\W_]/g,'').toLowerCase() === str.replace(/[\W_]/g,'').toLowerCase().split('').reverse().join('');
        }
    
  palindrome("0_0 (: /-\ :) 0-0");
</code>

Why W does not match underscore_ Doesn’t
W match non-text and numbers?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn