Comments (6)
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.
I'd like to give this a shot 🤚
from faker.
sounds good, thank you @keshavbiswa !
from faker.
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.
from faker.
yep, you got it! Thanks!
from faker.
Related Issues (20)
- Trying to call Faker::Music::Opera.saint_saens fails HOT 1
- Some generators have inconsistent names HOT 3
- Dota - Flaky specs
- New generator request: Faker::Commerce.rating HOT 2
- Use deterministic helper to execute the test provided in the block successive number of times HOT 9
- Improve testing of locales files HOT 2
- New generator request: Faker::Company.indian_gst_number HOT 3
- Outdated country names and inconsistencies in en/address.yml HOT 5
- Add benchmarking to faker-ruby HOT 6
- Deprecate Generators with External Calls HOT 3
- Fix/Deprecate `FmaBrotherhood` Generator HOT 2
- Reproducing "Faker::Base#regexify does not work with non-capturing groups or + repeat operator" on v 3.2.1 HOT 2
- `Faker::Time.backward (.forward)` may generate time which is greater (less) than the current time HOT 4
- Translation missing | en.faker.company.indian_gst_number HOT 6
- Consistent addresses HOT 3
- Drop support for Ruby 2.7 HOT 8
- Invalid GB phone number from `Faker::PhoneNumber.phone_number` HOT 3
- Fake Zip Codes HOT 6
- v3.2.3 correct? HOT 9
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 faker.