Git Product home page Git Product logo

Comments (6)

tom-lord avatar tom-lord commented on May 30, 2024 1

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.

tom-lord avatar tom-lord commented on May 30, 2024 1

"Fixed" in version 1.5.0 😃

from regexp-examples.

tom-lord avatar tom-lord commented on May 30, 2024

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.

taichi-ishitani avatar taichi-ishitani commented on May 30, 2024

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.

taichi-ishitani avatar taichi-ishitani commented on May 30, 2024

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.

taichi-ishitani avatar taichi-ishitani commented on May 30, 2024

Thank you!

from regexp-examples.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.