개발 도구

정규식 테스트

패턴, 그룹, 치환을 테스트합니다.

정규식 테스트

UtilBrix 제공

JavaScript regular expressions. Processing runs in a worker and stops after 3 seconds. Quick reference: \d digit, \w word, \s whitespace, + one or more, * zero or more, ^ start, $ end.

입력 내용은 브라우저에 보관됩니다. 계정이 필요하지 않습니다.

자세한 방법과 예시는 영어로 제공됩니다.

Step-by-step instructions (English)

  1. Enter a JavaScript regular-expression pattern and the desired flags.
  2. Paste representative test text, including examples that should not match.
  3. Optionally enter a replacement string, then inspect matches, groups, indexes, and replacement output.

공식 및 방법

The browser executes JavaScript RegExp semantics in a dedicated worker. Match details include text, zero-based UTF-16 indexes, captured groups, and named groups. The replacement string follows JavaScript replacement conventions, including $1 and named references.

실용 예시

The pattern \d+ with flag g finds 12 and 34 in order 12, item 34. A worker timeout stops patterns that take too long.

When this tool is useful

Develop a pattern for text extraction or cleanup before adding it to an application. Testing both matching and nonmatching examples helps catch a pattern that works on one sample but accepts too much.

Common mistakes and limitations

  • Regular-expression syntax and flags differ between languages; this tool uses JavaScript semantics.
  • A pattern can be expensive on long input. The worker time limit protects the page, but a timeout means the pattern needs review.

Practical questions about this tool (English)

Why am I seeing only one match?

Check the global g flag if you intend to find repeated matches. Other flags such as i and m affect case sensitivity and line boundaries rather than enabling all matches.

What do match indexes count?

Indexes are zero-based UTF-16 positions, matching JavaScript string indexing. Some visible symbols occupy multiple code units, so the index can differ from a visual character count.

관련 도구

UtilBrix 설치

홈 화면에서 도구를 바로 여세요.

  1. 브라우저 메뉴(⋮)를 여세요.
  2. ‘앱 설치’ 또는 ‘홈 화면에 추가’를 선택하세요.
  3. 확인하여 UtilBrix을 홈 화면에 추가하세요.

옵션이 없으면 Android의 Chrome에서 페이지를 여세요.

도구 검색

↑ ↓ Navigate · Enter Open · Esc Close