Write the shortest regular expression that matches every string in one list and rejects every string in the other. Twelve levels, live feedback, lower score wins.
한쪽 목록의 모든 문자열은 매치하고 다른 쪽 목록은 전부 거부하는, 가장 짧은 정규식을 작성하세요. 12개 레벨, 실시간 피드백, 짧을수록 승리.
Regex golf is a classic programming puzzle: you are given two lists of strings and must write one regular expression that matches everything in the first list while matching nothing in the second. The catch is length. Your score is the number of characters in the pattern, and like real golf a lower score is better. This version runs entirely in your browser using the JavaScript RegExp engine, gives you 12 levels of increasing difficulty, and shows a green tick or red cross next to every test string as you type so you can see exactly which cases your pattern still gets wrong.
The levels start with a plain literal substring and build up through the anchors ^ and $, character classes like [0-9] and [^aeiou], alternation, the quantifiers *, +, ? and {n}, lookahead, and finally backreferences such as (.)\1. It is a compact way to learn regular expressions or to warm up before writing a tricky pattern for real work. No signup, no tracking of your answers, and your best run is stored only in your own browser.
정규식 골프는 고전적인 프로그래밍 퍼즐입니다. 두 개의 문자열 목록이 주어지고, 첫 번째 목록의 모든 항목은 매치하면서 두 번째 목록은 하나도 매치하지 않는 정규식 하나를 작성해야 합니다. 핵심은 길이입니다. 점수는 패턴의 문자 수이며, 실제 골프처럼 점수가 낮을수록 좋습니다. 이 버전은 브라우저의 JavaScript RegExp 엔진으로 완전히 브라우저에서 실행되고, 난이도가 점점 높아지는 12개 레벨을 제공하며, 입력하는 동안 각 테스트 문자열 옆에 초록 체크 또는 빨간 X 를 표시해 어떤 경우가 아직 틀렸는지 바로 확인할 수 있습니다.
레벨은 단순 리터럴 부분 문자열로 시작해 앵커 ^·$, [0-9]·[^aeiou] 같은 문자 클래스, 선택(alternation), 수량자 *·+·?·{n}, 룩어헤드, 마지막으로 (.)\1 같은 역참조까지 단계적으로 확장됩니다. 정규식을 배우거나 실무에서 까다로운 패턴을 작성하기 전에 몸을 푸는 데 좋은 방법입니다. 가입도, 답안 추적도 없으며, 최고 기록은 본인 브라우저에만 저장됩니다.
Each level describes a rule and shows two lists: strings your regex must match and strings it must reject.
Type your regex between the slashes. Every test string gets a live green tick or red cross. Toggle the i, m and g flags if you need them.
The level clears once all match and all reject cases are green. Your score is the character count, so try to trim it before moving on.
Advance with Next level. At the end you get total characters used and average per level; your best full run is saved locally.
각 레벨은 규칙을 설명하고 두 목록을 보여줍니다: 정규식이 매치해야 하는 문자열과 거부해야 하는 문자열.
슬래시 사이에 정규식을 입력하세요. 각 테스트 문자열에 실시간으로 초록 체크 또는 빨간 X 가 표시됩니다. 필요하면 i, m, g 플래그를 켜세요.
매치·거부 항목이 모두 초록이 되면 레벨 통과입니다. 점수는 문자 수이므로 넘어가기 전에 최대한 줄여 보세요.
다음 레벨 버튼으로 진행합니다. 마지막에 총 사용 문자 수와 레벨당 평균이 표시되고, 최고 완주 기록은 로컬에 저장됩니다.