Skip to content

Fix regex syntax error by using raw strings in lesson 6.1#107

Open
0xrdan wants to merge 1 commit intoanthropics:masterfrom
0xrdan:fix/issue-103-regex-raw-strings
Open

Fix regex syntax error by using raw strings in lesson 6.1#107
0xrdan wants to merge 1 commit intoanthropics:masterfrom
0xrdan:fix/issue-103-regex-raw-strings

Conversation

@0xrdan
Copy link

@0xrdan 0xrdan commented Jan 6, 2026

Fixes #103

The REGEX_CATEGORIES dictionary used escape sequences like \) in regular strings, which causes Python SyntaxWarning for invalid escape sequences. Changed to raw strings (r"...") so the backslash is treated literally for the regex parser.

Changed in all three notebook variants:

  • Anthropic 1P/06_Precognition_Thinking_Step_by_Step.ipynb
  • AmazonBedrock/anthropic/06_Precognition_Thinking_Step_by_Step.ipynb
  • AmazonBedrock/boto3/06_Precognition_Thinking_Step_by_Step.ipynb

🤖 Generated with Claude Code

Fixes anthropics#103

The REGEX_CATEGORIES dictionary used escape sequences like `\)` in
regular strings, which causes Python SyntaxWarning for invalid escape
sequences. Changed to raw strings (r"...") so the backslash is treated
literally for the regex parser.

Changed in all three notebook variants:
- Anthropic 1P/06_Precognition_Thinking_Step_by_Step.ipynb
- AmazonBedrock/anthropic/06_Precognition_Thinking_Step_by_Step.ipynb
- AmazonBedrock/boto3/06_Precognition_Thinking_Step_by_Step.ipynb

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lesson 6.1 grading syntax error

1 participant