Git Product home page Git Product logo

Comments (6)

keshavbiswa avatar keshavbiswa commented on June 5, 2024 1

I think I got it, it's not matching the number (.mp3) as the extension. So updating the last part in the regex to assert for alphanumeric should do the job.

from faker.

keshavbiswa avatar keshavbiswa commented on June 5, 2024

I'd like to give this a shot 🤚

from faker.

thdaraujo avatar thdaraujo commented on June 5, 2024

sounds good, thank you @keshavbiswa !

from faker.

keshavbiswa avatar keshavbiswa commented on June 5, 2024

This seems like an issue with regexp_parser version bump.

It for some reason matches everystring but "whole-bless/cupiditate.mp3".

matcher = %r{^([a-z\-_.]+)(\\|/)([a-z\-_]+)\.([a-z]+)$}
matcher = Regexp.new Regexp.escape matcher if String === matcher

obj= "cutting-minister/qui.numbers"
matcher =~ obj

Regexp.last_match # => #<MatchData "cutting-minister/qui.numbers" 1:"cutting-minister" 2:"/" 3:"qui" 4:"numbers">

obj = "appointment-notebook/occaecati.bmp"
matcher =~ obj
Regexp.last_match # => #<MatchData "appointment-notebook/occaecati.bmp" 1:"appointment-notebook" 2:"/" 3:"occaecati" 4:"bmp">

# For some reason this doesn't work
obj = "whole-bless/cupiditate.mp3"
matcher =~ obj
Regexp.last_match # => Returns nil

I'm not a Regex expert, could someone help me understand what is the problem here?

from faker.

keshavbiswa avatar keshavbiswa commented on June 5, 2024

Screenshot 2023-12-13 at 2 01 18 PM
This works!

from faker.

thdaraujo avatar thdaraujo commented on June 5, 2024

yep, you got it! Thanks!

from faker.

Related Issues (20)

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.