Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

Validate French phone numbers

FRENCH_PHONE_PATTERN = /^(0|+33[s-]?)[1-9][s-]?(d{2}[s-]?){4}$/

def french_phone_number?(phone_number)
  # returns true or false
  !phone_number.match(FRENCH_PHONE_PATTERN).nil?
end
Comment

PREVIOUS NEXT
Code Example
Ruby :: ruby array infinity 
Ruby :: Rudy control S 
Ruby :: deliver_later not sending mail in sidekiq in rails 
Ruby :: run bundle without production in rails 
Ruby :: rails model on validation custom column name 
Ruby :: ruby pdf to file 
Ruby :: ruby on rails multiple models pagination 
Ruby :: start times from 1 in ruby 
Ruby :: rails admin overwrite view 
Ruby :: rails generate controller without view ,test 
Ruby :: Or even multiple scope parameters. For example, making sure that a teacher can only be on the schedule once per semester for a particular class. 
Ruby :: rails has_many through source 1 
Ruby :: time loop start with non zero in ruby 
Ruby :: ruby timeout 
Ruby :: class ruby 
R :: export csv in r 
R :: loop through list in r 
R :: i have library(dplyr) but i still get Error in select(., 
R :: r test normality 
R :: set row names in r 
R :: reverse string in r 
R :: how to itterate through a character in r 
R :: calculating RMSE, Rsquared with caret in R 
R :: how to summarise data but keep columns R 
R :: How to remove rows with inf from a dataframe in R 
R :: r get date from year and day 
R :: two string in one string r 
R :: formatc in r 
R :: point estimates and prediction intervals in r 
R :: dummify data in r 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =