Comments (6)
Interesting use case, thanks for the report.
As I said above, I think the laziest solution will be to simply make the placeholder pattern much more obscure - so it's virtually impossible to re-encounter this bug unless you intentionally go looking for it 😅
I'll fix this in a new release soon, when I get time. Should be very straightforward.
from regexp-examples.
"Fixed" in version 1.5.0
😃
from regexp-examples.
I wonder, did you encounter this in a real world scenario or because you were intentionally looking for a bug? 😉
This is caused by the "hacky" implementation of generating matches for regexes with back-references. Due to this code, I effectively say "any instance of __xx__
in the string is a placeholder, not a real part of the result".
Possible quick "fix": Make the placeholder longer/more obscure. It could be 100 "random" characters long, for all I care!
from regexp-examples.
Hi @tom-lord ,
Thanks for your comment and creating very useful Gem 😄
I wonder, did you encounter thi
I'm using your gem as random string generator for RSpec examples.
When I tried to generate a hidden method name like __a__
by using /__\w__/
regexp then I got this problem.
I have workaround for this bug; generate random string by using /\w/
regexp and then add __
to head and tail of generated string. Therefore I have no problem due to this bug.
https://github.com/rggen/rggen-basic-output-components/blob/aba7e720e89146c4223438ecfeb38a46ebd076b1/spec/rggen/basic_output_components/systemverilog_utility/identifier_spec.rb#L126
from regexp-examples.
As I said, I have a workaround for this bug. Therefore this is not a priority issue and you don't need to hurry.
from regexp-examples.
Thank you!
from regexp-examples.
Related Issues (17)
- Missing named properties HOT 1
- Empty regexp examples HOT 2
- Allow the use of empty look-arounds
- Randomness regression? HOT 2
- Enhancements to absent operator examples
- Support for conditional capture groups
- Parsing of nested repeat operators
- Predictable behaviour of `max_examples_limit` option
- Support for use without class extension
- enhancement: negative examples? HOT 2
- use regexp_parser? HOT 6
- Hello, I am trying to use regexp-example but I have an irregular expression and it says that the gem is not compatible with looking back and looking forward, can you help me? is there any solution or do I have to modify the regex? HOT 4
- [\p{Nd}] — unicode categories in character classes
- negative unicode property via \P is not supported HOT 2
- Can a reverse abilty be made? HOT 2
- symlink unimplemented when installing HOT 4
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 regexp-examples.