https://bugzilla.wikimedia.org/show_bug.cgi?id=38944

--- Comment #2 from Sam Wilson <[email protected]> 2012-08-03 06:18:17 UTC 
---
Well, I guess it's much faster this way, and one just needs to know to
construct regexes that are compatible with both PHP and the DBMS.  But I think
what I'm seeing here is not about incompatibility between the regex engines:
because the lines are being found correctly, but just highlighted wrongly.

The process seems to be as follows....

To preview, in SpecialReplaceText.php:

1. Use the DB's regexp to find the pages --
   regexCond(): "$column $op " . $dbr->addQuotes( $regex );
2. Then find the lines in each page that match --
   preg_match_all("/$target/", $text, $matches, PREG_OFFSET_CAPTURE);
3. Then, for each matching line, highlight the result --
   $targetStr = "/$target/U";
   preg_replace( $targetStr, '<span class="searchmatch">\0</span>', $snippet);
4. Then create the job, saving the page name, regex, etc.

Then to replace, ReplaceTextJob.php:

1. For each job, create new text --
   preg_replace( '/'.$target_str.'/U', $replacement_str, $article_text, -1,
$num_matches );

So is it just a matter of removing the Ungreedy modifiers?  That fixes the
highlighting problem that I'm seeing, but I'm sure other people know better
than I about what else that would break!

Thanks for taking the time to look at this.  :-)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to