一键导入
parse-extract-input
For text processing: extract numbers, words, structured data from messy text using regex patterns, parsing utilities.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
For text processing: extract numbers, words, structured data from messy text using regex patterns, parsing utilities.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Conducts iterative deep research on any topic using web search, progressive exploration, and structured synthesis. Use when asked for comprehensive research, deep investigation, thorough analysis, or multi-source exploration of any topic. Triggers: research, investigate, deep dive, comprehensive analysis, explore thoroughly, find everything about.
For cross-cutting concerns: add behavior without modifying functions, caching, timing, logging, validation wrappers.
For performance work: measure before changing, profile to find bottlenecks, compare before and after.
For symbolic computation: ASTs, mathematical expressions, code that manipulates code structure, expression transformations.
For ordered processing: A* search, Dijkstra, event simulation, task scheduling. Efficient min/max extraction with heap-based queue.
For dynamic programming: overlapping subproblems, recursive solutions with repeated computations, memoization to avoid redundant work.
| name | parse-extract-input |
| description | For text processing: extract numbers, words, structured data from messy text using regex patterns, parsing utilities. |
Use regex or helper functions to extract structured data from text.
import re
def ints(text):
"""Extract all integers from text."""
return tuple(map(int, re.findall(r'-?[0-9]+', text)))
def words(text):
"""Extract all words from text."""
return tuple(re.findall(r'[a-zA-Z]+', text))
def atoms(text):
"""Extract all atoms (numbers or identifiers)."""
return tuple(atom(s) for s in re.findall(r'[+-]?\d+\.?\d*|\w+', text))
def atom(s):
"""Parse string as number or keep as string."""
try:
return int(s)
except ValueError:
try:
return float(s)
except ValueError:
return s
import re
def ints(text: str) -> Tuple[int, ...]:
"""A tuple of all the integers in text."""
return tuple(map(int, re.findall(r'-?[0-9]+', text)))
def positive_ints(text: str) -> Tuple[int, ...]:
"""A tuple of all positive integers in text."""
return tuple(map(int, re.findall(r'[0-9]+', text)))
def digits(text: str) -> Tuple[int, ...]:
"""A tuple of all single digits in text."""
return tuple(map(int, re.findall(r'[0-9]', text)))
def words(text: str) -> Tuple[str, ...]:
"""A tuple of all alphabetic words in text."""
return tuple(re.findall(r'[a-zA-Z]+', text))
def atoms(text: str) -> Tuple:
"""A tuple of all atoms (numbers or identifiers)."""
return tuple(map(atom, re.findall(r'[+-]?\d+\.?\d*|\w+', text)))
def atom(text: str):
"""Parse text into a single float or int or str."""
try:
x = float(text)
return round(x) if x.is_integer() else x
except ValueError:
return text.strip()
# Usage examples
ints("Robot at (3, -5) with speed 10") # (3, -5, 10)
words("Hello, World! 123") # ('Hello', 'World')
atoms("x=42, y=3.14, name=foo") # ('x', 42, 'y', 3.14, 'name', 'foo')
r'-?[0-9]+' for signed integers-? for negative numbers