(text)
| 366 | // ============================================================ |
| 367 | |
| 368 | function extractVerificationCode(text) { |
| 369 | const matchCn = text.match(/(?:代码为|验证码[^0-9]*?)[\s::]*(\d{6})/); |
| 370 | if (matchCn) return matchCn[1]; |
| 371 | |
| 372 | const matchEn = text.match(/code[:\s]+is[:\s]+(\d{6})|code[:\s]+(\d{6})/i); |
| 373 | if (matchEn) return matchEn[1] || matchEn[2]; |
| 374 | |
| 375 | const match6 = text.match(/\b(\d{6})\b/); |
| 376 | if (match6) return match6[1]; |
| 377 | |
| 378 | return null; |
| 379 | } |
| 380 | |
| 381 | } // end of isTopFrame else block |