You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.
Hi,
I want to remove every line that matches a specific pattern completely (including newline).
I would expect that [ \t]*require_once[^\n\r]*\r?\n? would match every line that contains requrie_once.
In fact, only every second line is removed:
Testcase:
$ cat codemodtest/A.php
<?php
require_once 'B.php';
require_once 'C.php';
require_once 'D.php';
require_once 'E.php';
class A {
}
?>
$ codemod.py -m -d codemodtest --extension php,inc '[ \t]*require_once[^\n\r]*\r?\n?'''
$ cat codemodtest/A.php
<?php
require_once 'C.php';
require_once 'E.php';
class A {
}
?>
The text was updated successfully, but these errors were encountered:
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
Summary: facebookarchive/codemod#33 also repros in fastmod. The problem was that the amount we need to advance needs to depend on the length of the substitution: if it's zero, we need to continue scanning from the exact same offset instead of advancing.
Reviewed By: modocache
Differential Revision: D7705574
fbshipit-source-id: e58e06f79b108e3493a7c09cdd504fc07fadc05e
Hi,
I want to remove every line that matches a specific pattern completely (including newline).
I would expect that
[ \t]*require_once[^\n\r]*\r?\n?
would match every line that contains requrie_once.In fact, only every second line is removed:
Testcase:
The text was updated successfully, but these errors were encountered: