Sha256: 2fbb68574d0afe0617382dc5d718dbe3a3809f073f0c3d13146dcbdbd444868a

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

t = []
#t << "art-of-computer-programming-"
#t << "the-art-of-programming"
#t << "the.art.of.programming"
#t << "the_art_of_programming"
#t << "art.of.taling"
#t << "whatever there"
#t << "art of whatever"
#t << "tart.is.delicious"
#t << "the-art.of-sing"
#t << "nothing here"
#t << " art-anter"
#t << "Bug Bounty Playbook"
#t << "the art"
#t << "this  is (art) of bounty"

# test beginning
t << "r-cookbook-oreilly-cookbooks"
t << "r.dotbook"
t << "R.dotbook"
t << "r space"
# test middle
t << "using-r-for-data-analysis-in-social-sciences"
t << "using.r.for.data.analysis.in.social.sciences"
t << "using r for data analysis in social sciences"
t << "protein is doomed"
t << "protein-is-doomed"
t << "protein.is.doomed"
t << "ginger sings"
t << "ginger-sings"
t << "ginger.sings"
t << "the-earth-is-round"
# test end
t << "a-data-scientists-guide-to-acquiring-cleaning-and-managing-data-in-r"

name = "r"
lead = t.select { |v| 
  #v =~ /#{name}[-,.,_,\s]/ or
  #v =~ /[-,.,_,\s,^]#{name}[-,.,_,\s]/ or
  #v =~ /[-,.,_,\s]#{name}\z/ 

  v =~ /^#{name}[-,.,_,\s]/i

}
puts "lead length : #{lead.length}"

p res1

#res2 = t.select do |v|
#  v =~ /[-,.,_,\s]#{name}[-,.,_,\s,\z]/i
#end
#puts "res2 length : #{res2.length}"
#p res2


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elib_mgmt-cli-0.1.12 regex_test.rb
elib_mgmt-cli-0.1.9 regex_test.rb
elib_mgmt-cli-0.1.8 regex_test.rb