lib/hook/hookapp.rb
# Create a single regex for validation of an
# array by first char or full match.
Create a single regex for validation of an
array by first char or full match.
Create a single regex for validation of an array by first char or full match .
def format_regex(options)
    fmt_rx_array = []
    options.map {|fmt| fmt_rx_array.push(fmt.sub(/^(.)(.*?)$/, '\1(\2)?')) }
    Regexp.new("^(#{fmt_rx_array.join('|')})$",'i')
  end
def format_regex ( options ) fmt_rx_array = [ ] options . map { | fmt | fmt_rx_array . push ( fmt . sub ( / ^(.)(.*?)$ / , '\1(\2)?' ) ) } Regexp . new ( "^(#{fmt_rx_array.join('|')})$" , 'i' ) end
Create a single regex for validation of an
array by first char or full match.
Create a single regex for validation of an array by first char or full match .
options
<not_specific>