Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

Ruby regular expressions

str = "Ruby programming language is amazing!"

//.class  # => Regexp 

str =~ /R/    	#return the index of the first occurrence => 0
str =~ /m/	# => 11
/ing/ =~ str	# you can also flip it around => 13
"sky" =~ /[aeiou]/  # you can use a list of characters to match => nil
"love" =~ /[aeiou]/ # => 1
"%^%$%$" =~ /[a..z]/  # => nil

Comment

PREVIOUS NEXT
Code Example
Ruby :: rails automatically downcase on create 
Ruby :: rails string to html 
Ruby :: filter through array of arrays ruby 
Ruby :: rspec create list 
Ruby :: ruby on rails array contains multiple values 
Ruby :: ruby on rails 
Ruby :: number of trailing zeros in a factorial of a number. 
Ruby :: ide for ruby 
Ruby :: force stop rails server 
Ruby :: sentry send error manually ruby 
Ruby :: ruby array of symbols 
Ruby :: find subset of two hashes in ruby 
Ruby :: rails notprecompiled 
Ruby :: ruby find by multiple columns 
Ruby :: ruby zip rows and columns 
Ruby :: rails generate controller without view ,test 
Ruby :: ruby find frequency in array self.all 
Ruby :: ruby on rails db column contains string 
Ruby :: compiler version at runtime 
Ruby :: division in ruby 
R :: Drop rows with missing values in R 
R :: i have library(dplyr) but i still get Error in select(., 
R :: r merge multiple data frames at once 
R :: write to csv in r 
R :: how to substring in R from position 
R :: how to convert negative values to positive in R 
R :: R dplyr select 
R :: strtrim in r 
R :: get list of words that are in two lists using set 
R :: read.table tab separator 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =