가이드 연계 퀴즈 · 중간 레벨
AI 퀴즈로 정규식을 작성하는 방법
AI에 대한 패턴 설명, 정규식 앵커 및 RE2와 같은 특징을 파악하고 탐욕스러운 일치 및 치명적인 역추적을 테스트하는 방법을 확인하세요.
질문 1 의 8
Why is \d{5} without anchors a poor pattern for validating a ZIP code?
모든 질문 미리보기8 질문
퀴즈를 풀면 정답과 설명이 나타납니다.
- Why is \d{5} without anchors a poor pattern for validating a ZIP code?
- It only matches letters, not digits
- It can match five digits inside a longer string like "1234567"
- It is invalid syntax in most engines
- It requires a special Unicode flag to work
- What should a good regex request to an AI include?
- A request for the shortest possible pattern
- The name of your company and project
- A promise that you will test it later
- Examples that should and should not match, plus the regex flavor you use
- Google Sheets uses the RE2 engine. What does RE2 deliberately leave out?
- Backreferences and lookaround
- Character classes like [A-Z]
- Anchors like ^ and $
- Quantifiers like + and *
- What is catastrophic backtracking?
- A regex running out of memory on very short strings
- A regex tester highlighting the wrong characters
- Exponential slowdown on patterns like (a+)+ when input almost matches
- A regex that always returns an empty match
- Applied to the text "<a><b>", what does the greedy pattern <.*> match?
- Only "<a>"
- Nothing at all
- Only "<b>"
- The whole string "<a><b>"
- What does the guide suggest for validating email addresses?
- Use one perfect regex that implements the full email standard
- Use a simple sanity check plus a confirmation email
- Never validate email addresses at all
- Rely on lookbehind to check the domain
- For parsing HTML, JSON or other nested structures, what does the guide recommend?
- A longer and more detailed regex
- Using lazy quantifiers everywhere
- A real parser built for that format
- Switching to the RE2 engine
- Which Python function requires the entire string to match the pattern?
- re.fullmatch
- re.search
- re.findall
- re.sub