Regex 테스터
// 실시간 매칭으로 정규식을 테스트하고 디버그하세요
라이브 매칭
regex 패턴이나 테스트 문자열을 입력하면 즉시 매치가 업데이트됩니다.
시각적 결과
매치된 텍스트가 테스트 문자열에서 색상 배경으로 직접 하이라이트됩니다.
패턴 라이브러리
이메일, URL, 전화번호, IP 주소, 날짜의 일반적인 regex 패턴을 빠르게 삽입.
// REGEX
JavaScript RegExp:
Regular expressions (regex) are patterns used to match character combinations in strings. JavaScript supports flags: g (global), i (case-insensitive), m (multiline), s (dotAll), and u (unicode).
Example:
/\\d+/g matches "abc123def456" → ["123", "456"]
Use Cases:
- >Form validation: email, phone, URL
- >Text search and replace
- >Data extraction and web scraping
- >Log file analysis
- >Input sanitization
>> FAQ
Q: What is regex?
A: A regular expression is a sequence of characters that defines a search pattern for string matching, searching, and replacing.
Q: What do flags mean?
A: g (global) finds all matches. i ignores case. m (multiline) makes ^ and $ match line starts/ends. s (dotAll) makes . match newlines. u (unicode) enables full Unicode.
Q: What are capture groups?
A: Capture groups are created with parentheses () in a regex pattern to capture matched text for later reference.
Q: Greedy vs lazy matching?
A: Greedy quantifiers (*, +, {n,}) match as much text as possible. Lazy quantifiers (*?, +?, {n,}?) match as little as possible.
Q: Common regex patterns?
A: Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,} | URL: https?://[^\\s]+ | IP: \\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b
// 다른 언어
참고 자료
결과의 정확성을 확인하는 방법
아래 자동화 테스트로 이 도구를 검증합니다. 테스트 예시의 이름은 원문으로 표시합니다.
- Verification method
- Compare captures, global/case-insensitive results and Unicode zero-width match indices.
- Comparison reference
- Native JavaScript RegExp.matchAll.
- Verification scope
- Both use the same JS regex engine: this checks page iteration/presentation, not a second regex engine.
Test source and cases (select a file to read it)
-
parser-reliability.test.js
- Regex tester: captures, global matching and zero-width Unicode matches agree with native matchAll
테스트는 표시된 예시와 경계 조건을 다루며 모든 입력을 증명하지는 않습니다. 왕복 변환이나 같은 라이브러리를 사용하는 검사는 독립적인 검증이 아닙니다.