Monu Tools

정규식 테스터

정규식을 텍스트에 실시간으로 테스트합니다. 모든 일치 항목, 캡처 그룹, 플래그를 강조 표시합니다. 브라우저에서 실행됩니다.

정규식 테스터 사용 방법

  1. 01

    패턴 필드에 정규식을 입력하세요.

  2. 02

    필요한 플래그(g, i, m, s, u)를 선택하세요.

  3. 03

    테스트 문자열을 입력하면 캡처 그룹과 함께 일치 항목이 강조 표시됩니다.

What the regex tester does

The regex tester lets you build and debug regular expressions against your own sample text, with matches highlighted live as you type. It is useful for validating input formats, extracting fields from logs, or testing a pattern before pasting it into code.

Everything runs in your browser, so your patterns and test text are never uploaded.

Which engine it uses

It uses the JavaScript regular-expression engine, the same one in every browser and in Node.js, so a pattern that works here works in your JavaScript and TypeScript code.

Flags and capture groups

Toggle the global, case-insensitive, multiline and other flags to change how a pattern matches. You see every match along with its capture groups, so you can confirm exactly what each part of the pattern is pulling out.

Differences across regex flavors

Other languages such as PCRE, Python and Go share most syntax but differ in some features, so a few advanced constructs may behave differently outside JavaScript. If a pattern works here but not in another language, an engine-specific construct is usually the reason.

자주 묻는 질문

어떤 정규식 엔진을 사용하나요?

브라우저에 내장된 JavaScript(ECMAScript) 엔진을 사용하므로 JavaScript, TypeScript 코드와 동일한 결과를 얻습니다.

플래그의 의미는 무엇인가요?

g는 모든 일치 항목, i는 대소문자 무시, m은 ^와 $가 줄바꿈에서 일치, s는 점(.)이 줄바꿈에 일치, u는 전체 유니코드 처리를 활성화합니다.

여러 줄에 걸쳐 일치시키려면 어떻게 하나요?

multiline(m) 플래그를 활성화하면 ^와 $가 각 줄바꿈에서 일치합니다. 점(.)이 줄바꿈 문자에도 일치하게 하려면 dotAll(s) 플래그를 추가하세요.

캡처 그룹이 표시되나요?

네. 각 일치 항목에는 번호가 붙은 캡처 그룹이 나열되고, 이름이 있는 그룹은 이름으로 표시되어 각 패턴 부분이 캡처한 내용을 정확히 확인할 수 있습니다.

여기서는 동작하는데 다른 언어에서는 동작하지 않는 이유는 무엇인가요?

JavaScript 엔진을 사용합니다. PCRE, Python 등 다른 언어는 대부분의 문법을 공유하지만 역방향 탐색, 이름 있는 그룹, 일부 이스케이프에서 차이가 있으므로 고급 패턴을 이식할 때 주의하세요.

텍스트가 업로드되나요?

아니요. 패턴과 테스트 텍스트는 브라우저에서 평가되며 기기 밖으로 나가지 않습니다.

출처

이 도구 임베드하기

이 도구를 직접 운영하는 웹사이트에 추가하세요. 아래 코드를 복사하면 자동으로 최신 상태로 유지됩니다.

<iframe src="https://monu.tools/embed/ko/regex-tester" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

관련 도구