정적인 텍스트 찾기

hello world

regex: hello

hello world

Hello my friend, my fellows
// regex: my

결과: Hello my friend, my fellows

⇒ 대다수 정규식에서는 일치하는 부분을 리턴한다.

대소문자

모든 문자 찾기

// Q: report가 포함된 report + 1 의 문자를 찾아라
lecture2000.txt
report1.txt
spring.ppt
report9.ppt
report.png

// regex: report.

lecture2000.txt report1.txt spring.ppt report9.ppt

report.png

⇒ report로 시작하고 뒤에 아무 문자가 한개 붙는 것을 찾아냈다.

⇒ 전체 파일과 일치하는 것이 아니다. 문자에는 report.png처럼 . 자체를 조회가능하다.