Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
AZ、0-9、および空白を正規表現で無視したいのですが、現在これがあります。動作しますが、空白も無視されますが、必要です。
preg_match_all("/[^\w]/",$string,$matches);
\s空白文字を表します。\wしたがって、単語文字 ( ) または空白文字 ( )を除くすべての文字に一致させたい場合は、次のようにします\s。
\s
\w
preg_match_all("/[^\w\s]/",$string,$matches);