Tom Lord
Tom Lord
The "best" way to replicate generating examples for absent operator groups is with a negative lookbehind, e.g: ``` (?~abc) --> (?:.(? (?:[^a]*) ``` However (!!) this generalisation is not always...
The [official ruby documentation](https://ruby-doc.org/core/Regexp.html#class-Regexp-label-Character+Properties) does _not_ include a comprehensive list of all named properties supported by the language. Some examples: ``` /\p{Age=6.0}/ /\p{In Miscellaneous Mathematical Symbols-B}/ /\p{Transport and Map Symbols}/...
It would be nice to offer an option to use this gem without actually adding methods to the `Regexp` class. Something along the lines of: ``` require 'regexp-examples/module' RegexpExamples.examples(/.../) RegexpExamples.random_example(/.../)...
Ideally, `Regexp#examples` should always return up to `max_results_limit`. Currently, it usually "aborts" before this limit is reached. (I.e. the exact number of examples generated can be hard to predict, for...
Conditional capture groups, e.g. `/(group1)? (?(1)yes|no)/.examples` are not yet supported. This example should return: `["group1 yes", " no"]`. This has been a feature of the ruby language since `v2.0.0`, although...
Due to how this library's algorithm works, look-arounds cannot be supported. As [explained in the README](https://github.com/tom-lord/regexp-examples#impossible-features-illegal-syntax), a `RegexpExamples::IllegalSyntax` will be raised if they are used in a pattern you attempt...
RSpec/FilePath cop is completely skipped on routing specs, or specs that don't describe a constant
See: https://github.com/rubocop-hq/rubocop-rspec/blob/137dc91ba422d701eed88a121275dbdec182a180/lib/rubocop/cop/rspec/file_path.rb#L75-L79 For example, consider the following: ``` # spec/requests/bad_filename_format.rb RSpec.describe "Some really cool tests" do # ... end ``` Because a _constant_ was not defined (i.e. the test description...
0.1.5 --> 0.1.6: - Added "hex" ([a-fA-F0-9]), "start_of_string" (\A), "end_of_string" (\z). - Changed the way start/end of line are implemented slightly, as I think they were wrong/bug-prone. (See the related...
``` def alternatively(value = nil) @prefixes += "(?:" unless @prefixes.include?("(") @suffixes = ")" + @suffixes unless @suffixes.include?(")") add(")|(?:") find(value) if value end ``` I don't like this abuse of the...