MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / extractVerificationCode

Function extractVerificationCode

content/qq-mail.js:172–186  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

170// ============================================================
171
172function extractVerificationCode(text) {
173 // Pattern 1: Chinese format "代码为 370794" or "验证码...370794"
174 const matchCn = text.match(/(?:代码为|验证码[^0-9]*?)[\s::]*(\d{6})/);
175 if (matchCn) return matchCn[1];
176
177 // Pattern 2: English format "code is 370794" or "code: 370794"
178 const matchEn = text.match(/code[:\s]+is[:\s]+(\d{6})|code[:\s]+(\d{6})/i);
179 if (matchEn) return matchEn[1] || matchEn[2];
180
181 // Pattern 3: standalone 6-digit number (first occurrence)
182 const match6 = text.match(/\b(\d{6})\b/);
183 if (match6) return match6[1];
184
185 return null;
186}

Callers 1

handlePollEmailFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected