Skip to content
🔧

정규식 테스터

텍스트 및 코드 · 무료 온라인 도구

실시간 일치 강조로 정규식 테스트.

CoderNewbie 팀
//g
Flags:
2 matches found
80 문자
Highlighted Matches2 matches
Contact us at [email protected] or [email protected] — replies within 24h.

Match Details

#1pos: 14"[email protected]"groups: [hello, example.com]
#2pos: 35"[email protected]"groups: [support, codernewbie.com]

실시간 강조

패턴과 테스트 텍스트를 입력하는 즉시 일치 항목이 강조 표시됩니다.

캡처 그룹

각 일치 항목의 모든 캡처 그룹을 위치 및 값과 함께 명확히 검사.

플래그 지원

g, i, m 및 s 플래그를 전환하여 패턴을 미세 조정합니다.

정규식 테스터 사용 방법

  1. 1 Enter or paste your text or code into the input area.
  2. 2 Choose the desired operation (format, convert, analyze, etc.).
  3. 3 Click the action button to process.
  4. 4 Copy the result from the output area.

주요 기능

  • ✓ 100% 무료 — 가입, 구독, 광고 없음
  • ✓ 브라우저에서만 실행 — 데이터는 기기를 떠나지 않습니다
  • ✓ 빠르고 가벼움 — 즉시 결과 확인
  • ✓ 크로스 플랫폼 — 데스크톱, 태블릿, 모바일 지원

정규식 테스터 소개

Regular expressions (regex) are a pattern-matching language defined by IEEE POSIX and ECMAScript specifications. They describe search patterns using metacharacters and literals. A Regex Tester lets you evaluate patterns against test strings in real time, highlighting matches and capturing groups.

정규식 테스터 작동 원리

The tester compiles your pattern into a state machine (NFA/DFA) and applies it to the input string. Flags modify behavior: g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), y (sticky). Match results show position, captured groups, and named groups.

주요 활용 사례

  • ✓ Form validation — emails, phone numbers, postal codes
  • ✓ Log parsing — extract fields from structured log lines
  • ✓ URL routing — match path patterns in web frameworks
  • ✓ Search and replace — batch text transformations

Regex vs String Methods

String methods (includes, indexOf, startsWith) are simpler and faster for exact matches. Regex is necessary for pattern-based matching (e.g., 'all emails in a document'). For simple checks, prefer string methods; for flexible patterns, use regex. Overly complex regex can cause ReDoS (Regular Expression Denial of Service).

보안 및 개인정보

This tool runs entirely in your browser. Beware of ReDoS when using regex in production — certain patterns (e.g., nested quantifiers like (a+)+) can cause catastrophic backtracking. Use timeouts or safe regex libraries for user-supplied patterns.

기술 세부 정보

Specifications: ECMAScript 2024 (MDN Reference), IEEE POSIX. Metacharacters: . * + ? ^ $ { } [ ] \ | ( ). Character classes: \d \w \s \b. Quantifiers: * (0+), + (1+), ? (0-1), {n,m}. Lookahead: (?=...) (?!...). Lookbehind: (?<=...) (?<!...). Named groups: (?<name>...).

자주 묻는 질문

What is the difference between greedy and lazy quantifiers?

Greedy quantifiers (*, +) match as much as possible; lazy quantifiers (*?, +?) match as little as possible. Use lazy when you want the shortest match.

How do I test for a whole word?

Use word boundaries: \bword\b matches 'word' but not 'sword' or 'words'.

What are lookahead and lookbehind?

Lookahead (?=...) asserts what follows without consuming it. Lookbehind (?<=...) asserts what precedes. They are zero-width assertions useful for conditional matching.

관련 도구

개념 배우기

개념 배우기

이 도구 뒤에 있는 프로그래밍 개념을 이해하세요.