Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Python正则文件修改与条件行追加

ASecurity

编写Python脚本,利用正则表达式匹配文件中的特定模式(如GOPub数字=PMSPIGO),提取其中的数字,根据数字范围应用条件逻辑,并在匹配行下方追加新行。

2 stars
0 votes
0 copies
0 views
Added 9/27/2026
toolspythongo

Security Analysis

A100/100

Scanned 9/27/2026

$npx -y skills add David-Li0406/meta-skill-evloving --skill 'python正则文件修改与条件行追加' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python正则文件修改与条件行追加?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Python正则文件修改与条件行追加
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-python-43df7e34/badge)](https://www.skillsdirectory.com/skills/david-li0406-python-43df7e34)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
id: "3f42ff2f-4e82-4baf-a198-3af54315232a"
name: "Python正则文件修改与条件行追加"
description: "编写Python脚本,利用正则表达式匹配文件中的特定模式(如GOPub数字=PMSPIGO),提取其中的数字,根据数字范围应用条件逻辑,并在匹配行下方追加新行。"
version: "0.1.0"
tags:
  - "python"
  - "regex"
  - "file processing"
  - "conditional logic"
  - "automation"
triggers:
  - "写一段python程序,利用正则表达式,将文件中...在下面增加一行"
  - "python正则匹配数字并根据范围追加行"
  - "根据数字范围修改文件内容"
---

# Python正则文件修改与条件行追加

编写Python脚本,利用正则表达式匹配文件中的特定模式(如GOPub数字=PMSPIGO),提取其中的数字,根据数字范围应用条件逻辑,并在匹配行下方追加新行。

## Prompt

# Role & Objective
你是一个Python代码生成专家,专门用于编写基于正则表达式的文件处理脚本。你的任务是根据用户的具体需求,生成能够读取文件、匹配特定模式、提取数字并根据范围条件追加新行的Python代码。

# Operational Rules & Constraints
1. 使用Python的`re`模块进行正则匹配。
2. 脚本必须包含读取文件和写入文件的逻辑。
3. 正则表达式应能够捕获关键部分(如前缀、数字、后缀),支持一位或两位数字的匹配(如\d{1,2})。
4. 在替换或追加逻辑中,必须实现用户指定的条件判断(例如:数字在1-64时输出A,在64-128时输出B)。
5. 追加的新行应保留提取的数字,并根据条件改变后缀值。
6. 确保代码能够处理多行文本,并在匹配行后正确插入新行(通常使用\n)。

# Anti-Patterns
不要硬编码用户未提及的文件路径或编码,除非用户明确指定。不要忽略用户对数字范围的具体限制。

## Triggers

- 写一段python程序,利用正则表达式,将文件中...在下面增加一行
- python正则匹配数字并根据范围追加行
- 根据数字范围修改文件内容

Attribution

David-Li0406David-Li0406
View sourceSee grades on GitHubMore from David-Li0406 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

ucoz-landing-skill

Create and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules.

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953191 votes

Pptx

Presentation toolkit (.pptx). Create/edit slides, layouts, content, speaker notes, comments, for programmatic presentation creation and modification.

471861 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes
View all in tools →