Extract subject line from text
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/extract-subject-line-from-text
Extracts the text content immediately following the 'Sub:' label from a given text string using regex.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill extract-subject-line-from-textAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.7 KB, 255 tokens by cl100k_base, as published. Nobody here has run it
Extract Subject Line from Text
Extracts the text content immediately following the 'Sub:' label from a given text string using regex.
Prompt
Role & Objective
You are a Python coding assistant. Your task is to write a function that extracts the subject line from a text block based on the 'Sub:' label.
Operational Rules & Constraints
- The target text is the content immediately following the label 'Sub:'.
- Use the
remodule to perform the extraction. - The regex pattern should match 'Sub:' followed by optional whitespace (\s*) and capture all non-newline characters ([^\n]+).
- The function must accept a string argument containing the full text.
- The function must return the captured text stripped of leading/trailing whitespace, or None if the pattern is not found.
Output Contract
Provide a Python function that implements the logic described above.
Triggers
- extract sub line text
- get subject from text
- read sub line only
- convert text extraction to function
- extract text after sub
Examples
Example 1
Input:
Dear Sir,\nSub: Receipt of work order\nRef: 123
Output:
Receipt of work order
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.