모든 도구
무료

검색하고 인쇄할 수 있는 정규 표현식 참조 자료——문자 클래스, 앵커, 수량자, 그룹, 룩어라운드, 플래그, 바로 쓸 수 있는 패턴. 무료.

Character classes

12
\d
Any digit, equivalent to [0-9]
\D
Any non-digit character
\w
Word character: letter, digit or underscore
\W
Any non-word character
\s
Any whitespace (space, tab, newline)
\S
Any non-whitespace character
.
Any character except newline
[abc]
Any one of a, b or c
[^abc]
Any character except a, b or c
[a-z]
Any lowercase letter in the range
[A-Za-z0-9]
Any alphanumeric character
[\d\s]
Combine classes inside brackets

Anchors & boundaries

8
^
Start of string (or line in multiline mode)
$
End of string (or line in multiline mode)
\b
Word boundary between \w and \W
\B
Not a word boundary
\A
Start of the entire string (PCRE)
\z
End of the entire string (PCRE)
\Z
End of string, before a trailing newline (PCRE)
\G
Start of the current match attempt (PCRE)

Quantifiers

11
*
Zero or more of the preceding token
+
One or more of the preceding token
?
Zero or one (makes it optional)
{n}
Exactly n repetitions
{n,}
n or more repetitions
{n,m}
Between n and m repetitions
*?
Lazy: zero or more, as few as possible
+?
Lazy: one or more, as few as possible
??
Lazy: optional, prefers zero
{2,5}?
Lazy bounded repetition
a++
Possessive: no backtracking (PCRE)

Groups & backreferences

9
(abc)
Capturing group, stores the match
(?:abc)
Non-capturing group
(?<name>abc)
Named capturing group
(?P<name>abc)
Named group, alternate PCRE syntax
a|b
Alternation: match a or b
(red|blue)
Grouped alternation
\1
Backreference to capturing group 1
\k<name>
Backreference to a named group
$1
Reference group 1 in a replacement

Lookaround

6
(?=abc)
Positive lookahead: followed by abc
(?!abc)
Negative lookahead: not followed by abc
(?<=abc)
Positive lookbehind: preceded by abc
(?<!abc)
Negative lookbehind: not preceded by abc
\d(?=px)
Digit only if followed by px
(?<=\$)\d+
Digits only if preceded by a dollar sign

Flags & modifiers

10
g
Global: find all matches, not just the first
i
Case-insensitive matching
m
Multiline: ^ and $ match line breaks
s
Dotall: . also matches newline
u
Unicode mode (full code points)
x
Extended: ignore whitespace, allow comments
y
Sticky: match from lastIndex (JS)
(?i)
Inline case-insensitive flag (PCRE)
(?im)
Combine inline flags
(?i:abc)
Scoped inline flag for a group

Escapes & special chars

11
\.
Literal dot
\\
Literal backslash
\/
Literal forward slash (in /.../ literals)
\t
Tab character
\n
Newline (line feed)
\r
Carriage return
\f
Form feed
\0
Null character
\xFF
Character by two-digit hex code
\x{00E9}
Unicode code point by hex (PCRE)
\Qabc\E
Quote a literal block (PCRE)

Common token shortcuts

10
[0-9]
Single digit, same as \d
[a-fA-F0-9]
A single hexadecimal digit
\d+
One or more digits (whole number)
\w+
One or more word characters
\s+
One or more whitespace characters
.*
Any run of characters (greedy)
.*?
Any run of characters (lazy)
[^\s]+
One or more non-whitespace characters
\b\w+\b
A whole word
(?:\r\n|\n|\r)
Any line ending

Practical patterns

10
^[\w.+-]+@[\w-]+\.[\w.-]+$
Simple email address
https?:\/\/[^\s]+
HTTP or HTTPS URL
\b(?:\d{1,3}\.){3}\d{1,3}\b
IPv4 address
#?[a-fA-F0-9]{6}\b
Six-digit hex color
\d{4}-\d{2}-\d{2}
Date in YYYY-MM-DD format
\+?\d[\d\s-]{7,}\d
Phone number (loose)
[a-z0-9]+(?:-[a-z0-9]+)*
URL slug (lowercase, hyphens)
^\s+|\s+$
Leading or trailing whitespace (trim)
\s{2,}
Two or more consecutive spaces
<[^>]+>
An HTML tag (naive)

Unicode properties

10
\p{L}
Any kind of letter from any language
\P{L}
Any character that is not a letter
\p{N}
Any kind of numeric character
\p{Lu}
An uppercase letter
\p{Ll}
A lowercase letter
\p{P}
Any punctuation character
\p{Sc}
A currency symbol
\p{Han}
A Han (Chinese) script character
\p{Emoji}
An emoji character (where supported)
\p{Greek}
A character from the Greek script

“:q”와 일치하는 항목이 없습니다.


Regex 치트시트 소개

이 정규식 치트시트는 정규 표현식 구문에 대한 간결한 참고 자료입니다: 문자 클래스, 앵커와 경계, 수량자, 그룹과 역참조, 전후방탐색, 플래그와 수정자, 이스케이프와 특수 문자, 자주 쓰는 토큰 단축키, 실용적인 완성형 패턴, 유니코드 속성까지 다룹니다.

정규식은 한 번 쓰고 마는 구문의 전형입니다 — 토큰은 간결하고 혼동하기 쉬우며, 특히 전방탐색과 후방탐색, 탐욕적 수량자와 게으른 수량자, 여러 그룹 형태가 그렇습니다. 각 행은 하나의 토큰이나 패턴을 무엇과 일치하는지에 대한 쉬운 설명과 함께 보여줍니다.

이 시트는 그대로 복사해서 쓸 수 있는 실용적인 패턴으로 마무리되며, 여기 모든 치트시트와 마찬가지로 무료이며 클라이언트 사이드로 동작합니다: 실시간 검색, 고정된 목차, 모든 토큰에 대한 원클릭 복사, 종이 정규식 참고 자료를 위한 인쇄 버튼이 있습니다.

Regex 치트시트 사용 방법

  1. 문자 클래스와 앵커 및 경계부터 실용적인 패턴과 유니코드 속성까지 섹션을 훑어보세요.
  2. lookahead, \d, lazy 같은 토큰이나 개념을 검색해 시트를 즉시 필터링하세요.
  3. 바로 활용할 표현식이 필요할 때는 실용적인 패턴으로 이동하세요.
  4. 토큰이나 패턴, 또는 복사 아이콘을 클릭해 코드나 정규식 테스터에 복사하세요.
  5. 시트를 인쇄하세요 — 정규식 구문은 종이로 보관하기 좋은 전형적인 예입니다.

자주 묻는 질문

열 개 섹션입니다: 문자 클래스, 앵커와 경계, 수량자, 그룹과 역참조, 전후방탐색, 플래그와 수정자, 이스케이프와 특수 문자, 토큰 단축키, 실용적인 패턴, 유니코드 속성입니다.

네. 실용 패턴 섹션에는 자주 쓰는 매칭 작업을 위한 완성된 표현식이 담겨 있어, 토큰 하나하나 조합하는 대신 그대로 복사해서 활용할 수 있습니다.

네. 전후방탐색 섹션은 긍정 및 부정 전방탐색과 후방탐색을 설명과 함께 나란히 나열합니다 — 정규식 구문 중 가장 혼동되는 부분 중 하나입니다.

여기 표시된 구문은 문자 클래스, 수량자, 그룹, 전후방탐색, 플래그, 유니코드 속성 이스케이프를 포함해 주요 엔진들이 널리 공유하는 핵심 구문입니다. 엔진별 확장 기능은 다를 수 있으므로 특이한 구문은 사용하려는 언어에서 직접 테스트하세요.

네, 완전히 무료입니다 — 검색 가능하고 인쇄할 수 있으며 전적으로 브라우저에서 렌더링됩니다.


인기 검색어
regex cheat sheet regular expression syntax regex character classes regex lookahead and lookbehind regex quantifiers list regex flags reference common regex patterns regex email pattern
도움이 필요하신가요?
이 도구에서 문제를 발견하셨나요? 저희 팀에 알려주세요.
문제 신고

이 무료 도구를 귀하의 웹사이트에 추가하세요 — 아래 코드를 복사하여 붙여넣으세요.