• 회원가입
  • 로그인
  • 구글아이디로 로그인

[regex] PHP 정규표현식 패턴 20강 - \s (역슬래시 소문자s) : 모든 공백 , \S (역슬래시 대문자S) : 공백 아닌 모든 것

1,945  

 

 


 패턴 20  -  \s  (역슬래시 소문자s)  :  모든 공백
                 
\S  (역슬래시 대문자S)  :  모든 공백을 제외한 문자

모든 공백엔 space, new line, tab  모두 포함.
 

Source

Ere iron was found or tree was hewn

Case 1  - 모든 흰색 공백

Regular Expression: \s
First match: Ere iron was found or tree was hewn
All matches: Ere iron was found or tree was hewn

Case 2  -  흰색 공백을 제외한 모든 문자

Regular Expression: \S
First match: Ere iron was found or tree was hewn
All matches: Ere iron was found or tree was hewn

 


분류 제목
regex JS 50강 - 정규표현식 (2/7) : 패턴만들기
regex JS 49강 - 정규 표현식 (1/7) : 오리엔테이션
3/3
목록
찾아주셔서 감사합니다. Since 2012