Skip to content

fix: fix regex crash in chapter01 when content contains newlines 修复chapter01中正则表达式匹配换行报错问题 #447

Open
KevinJosephDavis wants to merge 1 commit intodatawhalechina:mainfrom
KevinJosephDavis:main
Open

fix: fix regex crash in chapter01 when content contains newlines 修复chapter01中正则表达式匹配换行报错问题 #447
KevinJosephDavis wants to merge 1 commit intodatawhalechina:mainfrom
KevinJosephDavis:main

Conversation

@KevinJosephDavis
Copy link
Copy Markdown

Fixed the AttributeError caused by re.match() not supporting multi-line content.

Changes:

  • Replace re.match() with re.search()
  • Add re.DOTALL flag to support multi-line matching
  • Resolve 'NoneType' object has no attribute 'group' error

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.

1 participant