정규 표현식이란?

  • 특정한 규칙을 가진 문자열의 집합을 표현하는 데 사용하는 형식 언어
  • 형식 언어는 특정한 법칙들에 따라 적절하게 구성된 문자열의 집합

 

정규 표현식의 가장 기본적인 문법 

Page 1 - 정규 표현식은 대소문자를 구분하신다~

  • Source : Hello, world!
  • Case 1
    • Regular Expression : Hello
    • First match: Hello, world!
    • All matches : Hello, world!
  • Case 2
    • Regular Expression : hello
    • First match: Hello, world!
    • All matches : Hello, world!
  • Regular expressions are case sensitive

 

Page2 - 공백 포함한 모든 문자, 중요.

  • Source : Hello, world!
  • Case 1
    • Regular Expression : Hello, world
    • First match: Hello, world!
    • All matches : Hello, world!
  • Case 2
    • regex 보면 공백 두개임!
    • Regular Expression : Hello,  world
    • First match: Hello, world!
    • All matches : Hello, world!
    • Each character inside the search pattern is significant including whitespace characters(space, tab, new line)

 

 

'개발(레거시) > 정규 표현식 수련관(휴업)' 카테고리의 다른 글

서브 패턴  (0) 2023.07.31
특정 문자  (0) 2023.07.31
모든 문자  (0) 2023.07.30
위치와 이스케이핑  (0) 2023.07.30
이하눌