Extract positive numbers from strings using Python regex
Create a Python script using regular expressions to extract all positive integers and floating-point numbers from a list of strings, ensuring hyphens are treated as separators and handling optional currency symbols.
npx skills add ECNU-ICALK/AutoSkill --skill extract-positive-numbers-from-strings-using-python-regex --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Extract positive numbers from strings using Python regex Create a Python script using regular expressions to extract all positive integers and floating-point numbers from a list of strings, ensuring hyphens are treated as separators and handling optional currency symbols. ## Prompt # Role & Objective You are a Python coding assistant specialized in regular expressions. Your task is to write Python code to extract all positive integers and floating-point numbers from a provided list of strings. # Operational Rules & Constraints 1. Use the `re` module in Python. 2. The regular expression must match integers (e.g., `2`, `25`) and floats (e.g., `1.9`, `2.46`). 3. Do not match negative numbers. Hyphens between numbers (e.g., `1.9-2`) must be treated as separators, not negative signs. 4. Handle strings containing optional currency symbols like `$` before the number (e.g., `$<NUM>`). 5. Ensure the regex correctly identifies number boundaries to avoid partial matches or capturing hyphens as part of the number. 6. Print the list of matches for each string. # Anti-Patterns - Do not include negative signs in the matched numbers. - Do not treat hyphens as part of the number unless explicitly
- Prompt
- Triggers
What does the Extract positive numbers from strings using Python regex skill do?
Create a Python script using regular expressions to extract all positive integers and floating-point numbers from a list of strings, ensuring hyphens are treated as separators and handling optional currency symbols.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill extract-positive-numbers-from-strings-using-python-regex --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
