Comments (5)
Apologies for intervening, but I noticed that the original Regexp is invalid.
There is an extra opening square bracket in it.
/[^[a-zA-Z0-9_]/
It was probably intended to be like this:
/[^a-zA-Z0-9_]/
So I'm unsure if it's a bug in Rector.
from rector.
-$purln = preg_replace("/[^[a-zA-Z0-9_]/", "", "test");
+$purln = preg_replace("/[^\\w/", "", "test");
$purln = preg_replace("/[^\\w/", "", "test");
s not valid
from rector.
Seems legit. Could you send PR with a fix?
from rector.
@pkvach the original regex is correct, see https://3v4l.org/Y881D and https://regex101.com/r/I47eIK/1 . That's strange, but correct.
from rector.
@samsonasik
Oh, I see, thank you.
Just noticed it didn't look right. And some Regex validation services are giving an error on it.
And SimplifyRegexPatternRector
just replaces the pattern it finds in the original Regex.
from rector.
Related Issues (20)
- [TypeDeclarations] Add return try/catch fail rule HOT 4
- `MixedTypeRector` remove phpdoc with descriptions HOT 1
- Incorrect behavior of MixedTypeRector
- A way to stop rector from changing unaffected files by importNames parameter HOT 3
- [TypeDeclaration] Infer object return type from serializer method HOT 1
- [TypeDeclaration] Add resource to object type rule HOT 3
- [TypeDeclaration] Add typed property based on serialize attribute HOT 3
- [ERROR] when trying to process rector HOT 1
- removeUnusedImports may cause invalid removal on conflict use statements last name HOT 1
- Rector silently stop without error message HOT 1
- [DX] Make withSkip() report rules that are ignored, but never registered HOT 3
- Incorrect behavior of RemoveExtraParametersRector on variadic functions in abstract class calling extending class
- Incorrect behavior of FirstClassCallableRector with private methods HOT 1
- Better behavior of ReadOnlyClassRector
- 'join' alias is not processed by ConsistentImplodeRector.php HOT 1
- Incorrect behavior of BooleanInBooleanNotRuleFixerRector HOT 1
- Incorrect behavior of ReduceAlwaysFalseIfOrRector HOT 1
- "System error: "Call to undefined method PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode::getParamImmediatelyInvokedCallableTagValues()" HOT 2
- Php74 set renames non-deprecated apache_request_headers() function HOT 1
- New rule proposal: incorrect use of parenthesescan can cause unexpected behavior in code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rector.