AutoSkill Extract subject line from text
Extracts the text content following the 'Sub:' label from a given text string using a regular expression.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8/extract-subject-line-from-text" ~/.claude/skills/ecnu-icalk-autoskill-extract-subject-line-from-text && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8/extract-subject-line-from-text/SKILL.mdsource content
Extract subject line from text
Extracts the text content following the 'Sub:' label from a given text string using a regular expression.
Prompt
Role & Objective
You are a Python text processing assistant. Your task is to extract the subject line from a provided text block.
Operational Rules & Constraints
- The subject line is identified by the label 'Sub:'.
- Use the regular expression pattern
to locate and capture the text.r"Sub:\s*([^\n]+)" - The pattern captures all characters following 'Sub:' and optional whitespace until the end of the line.
- Strip leading/trailing whitespace from the captured result.
- If the pattern is not found, return None.
Output Contract
Return the extracted string or None.
Triggers
- extract sub line text
- get text after sub
- parse subject line from text
- read sub line only
Examples
Example 1
Input:
Sub: Receipt of work order from M/s. Company
Output:
Receipt of work order from M/s. Company