MCPcopy
hub / github.com/ElricLiu/AutoGPT-Next-Web / removeTaskPrefix

Function removeTaskPrefix

src/utils/helpers.ts:20–27  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

18};
19
20export const removeTaskPrefix = (input: string): string => {
21 // Regular expression to match task prefixes. Consult tests to understand regex
22 const prefixPattern =
23 /^(Task\s*\d*\.\s*|Task\s*\d*[-:]?\s*|-?\d+\s*[-:]?\s*)/i;
24
25 // Replace the matched prefix with an empty string
26 return input.replace(prefixPattern, "");
27};
28
29export const extractTasks = (
30 text: string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected