| | $combined = '~' . implode( '|', $patterns ) . '~msu'; |
| | |
| | - // --- DEBUG START --- |
| | - if (strpos($this->content, 'DialogBox') !== false) { |
| | - echo "<div style='background: #333; color: #fff; padding: 10px; white-space: pre-wrap;'>"; |
| | - echo "<strong>Detected Language:</strong> " . htmlspecialchars($this->lang) . "\n"; |
| | - echo "<strong>Keyword Rule:</strong> " . htmlspecialchars($this->rules['keyword'] ?? 'NONE') . "\n"; |
| | - echo "<strong>Combined Regex:</strong> " . htmlspecialchars($combined) . "\n"; |
| | - echo "</div>"; |
| | - } |
| | - // --- DEBUG END --- |
| | - |
| | $result = preg_replace_callback( $combined, function( $matches ) { |
| | foreach( $matches as $key => $value ) { |