expect(subject).to receive(:bar).with(/regex/) subject.bar(/regex/) # satisfies the expectation subject.bar('regex') # also satisfies the expectation This is usually not an issue, except when your method arguments...

...are things like classes, regexps or ranges. If you want to expect strict equality, you could use expect(subject).to receive(:foo).with(eq(MyClass)) or expect(subject).to receive...

Verwenden der gitlab container registry Wenn ein git tag gepushed wird, der die regex /^v\d+.\d+.\d+$/ matched, soll ein container image mit genau diesem tag gepushed werden...

...DEFAULT_TERSER_OPTIONS = { compress: { // https://github.com/terser/terser#compress-options passes: 3, }, mangle: { // https://github.com/terser/terser#mangle-options properties: { regex: /^[_#]/ // https://makandracards.com/makandra/608582 } }, ecma: 2021, nameCache: TERSER_NAME_CACHE, // preserve renames across files } function terserPlugin...

...steps like this: 'I should see the items "{array}"' ParameterType( name: 'array', # Note: the RegEx no longer includes the ^ and $ delimiter: regexp: /\[([^"\[\]]*)\]/, type: Array, transformer: lambda do |array_string|

...based on your existing Transform to "parameter_types.rb" using the Proxy class. ParameterTypeProxy.add( name: 'number', regexp: /\d/, type: Integer, transformer: lambda(&:to_i) ) 2.: These few lines allow you to use...

...at the location context to add an expire header to all files matching the regex. What about when I change a file? Changed stylesheets and javascripts will always be reloaded...

Developing complex regular expressions quickly blows my mind. Here are some online regex editors that help you by highlighting matching text and capture groups: Ruby: Rubular Javascript: RegExr Regular expression...

...searchValue, replaceValueOrFn) by default replaces only the first match of a given String or RegExp. When supplying a RegExp as the searchValue argument, you can specify the g ("global") modifier...

...replaceAll(searchValue, replaceValueOrFn) you can easily replace all occurences of a given String or Regex. 'Hello World'.replaceAll(/o/g, 'ö') // => 'Hellö Wörld' // same as replace 'Hello World'.replaceAll(/o/, 'ö...

...some clicks" and the condition "click element matches CSS selector ..." A "Custom Event" with ".*" regex matching can be used to trigger on any GTM event. Can be restricted with conditions...

makandra dev

...issues with BigDecimal('12.3') Use ' ' for nbsp helper instead of 0xC2.chr + 0xA0.chr Remove /s regex modifier (your files are UTF8 anyway Remove rcov In Rakefile, replace require 'rake/rdoctask' with require...

jimneath.org

...from last successful match) ...and many more you'll need when reading weird code. Regex $~ (last MatchData) $1 $2 $3 $4 (match groups from the last pattern match) $& (last matched...

wiki.macromates.com

...per-project settings): [ "*_steps.rb" ] fileType = "source.ruby.rspec.cucumber.steps" Apparently, this works for any files. Define a regex and specify custom settings. The attached article lists all available configuration options (which are many...

regular-expressions.info

A little-known feature of modern Regexp engines that help when optimizing a pattern that will be matched against long strings: An atomic group is a group that, when the...

...regex engine exits from it, automatically throws away all backtracking positions remembered by any tokens inside the group...

stackoverflow.com

...a string that matches more than 1 of them. Short of writing my own regex engine with this use case in mind, is there an easy way in C++ or...

...string, length: int) You may update gem sanitize from 2.x to 4+ In regexes \w does not match umlauts and other special characters. If it is supposed to you...