Skip to content

fix: use raw strings for regex patterns in lesson 6.1 grading#133

Open
atian8179 wants to merge 1 commit intoanthropics:masterfrom
atian8179:fix/regex-raw-strings
Open

fix: use raw strings for regex patterns in lesson 6.1 grading#133
atian8179 wants to merge 1 commit intoanthropics:masterfrom
atian8179:fix/regex-raw-strings

Conversation

@atian8179
Copy link

Add r prefix to regex pattern strings in REGEX_CATEGORIES to prevent SyntaxError from invalid escape sequences. Applied to all 3 notebook variants.

Closes #103

The REGEX_CATEGORIES dict uses escaped parentheses (e.g. 'A\) P')
but without raw string prefix, Python's string parser tries to
interpret the escape sequence before passing it to re.search(),
causing a SyntaxError.

Fix all 3 variants of the notebook (Anthropic 1P, Bedrock/anthropic,
Bedrock/boto3).

Closes anthropics#103
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