| 370 | } |
| 371 | |
| 372 | static void TestRecursion(int size, const char* pattern) { |
| 373 | // Fill up a string repeating the pattern given |
| 374 | std::string domain; |
| 375 | domain.resize(size); |
| 376 | size_t patlen = strlen(pattern); |
| 377 | for (int i = 0; i < size; i++) { |
| 378 | domain[i] = pattern[i % patlen]; |
| 379 | } |
| 380 | // Just make sure it doesn't crash due to too much recursion. |
| 381 | RE2 re("([a-zA-Z0-9]|-)+(\\.([a-zA-Z0-9]|-)+)*(\\.)?", RE2::Quiet); |
| 382 | RE2::FullMatch(domain, re); |
| 383 | } |
| 384 | |
| 385 | // A meta-quoted string, interpreted as a pattern, should always match |
| 386 | // the original unquoted string. |