lib/arjdbc/mssql/limit_helpers.rb
def split_sql(rest_of_query, *regexs)
          results = Array.new

          regexs.each do |regex|
            if position = (regex =~ rest_of_query)
              # Extract the matched string and chop the rest_of_query
              matched       = rest_of_query[position..-1]
              rest_of_query = rest_of_query[0...position]
            else
              matched = nil
            end

            results << matched
          end
          results << rest_of_query

          results
        end
# Split the rest_of_query into chunks based on regexs (applied from end of string to the beginning)
# The result is an array of regexs.size+1 elements (the last one being the remaining once everything was chopped away)
Split the rest_of_query into chunks based on regexs (applied from end of string to the beginning)
The result is an array of regexs.size+1 elements (the last one being the remaining once everything was chopped away)
Split the rest_of_query into chunks based on regexs ( applied from end of string to the beginning ) The result is an array of regexs . size + 1 elements ( the last one being the remaining once everything was chopped away )
def split_sql(rest_of_query, *regexs)
          results = Array.new
          regexs.each do |regex|
            if position = (regex =~ rest_of_query)
              matched       = rest_of_query[position..-1]
              rest_of_query = rest_of_query[0...position]
            else
              matched = nil
            end
            results << matched
          end
          results << rest_of_query
          results
        end
def split_sql ( rest_of_query , * regexs ) results = Array . new regexs . each do | regex | if position = ( regex =~ rest_of_query ) matched = rest_of_query [ position .. - 1 ] rest_of_query = rest_of_query [ 0 ... position ] else matched = nil end results << matched end results << rest_of_query results end
Split the rest_of_query into chunks based on regexs (applied from end of string to the beginning)
The result is an array of regexs.size+1 elements (the last one being the remaining once everything was chopped away)
Split the rest_of_query into chunks based on regexs ( applied from end of string to the beginning ) The result is an array of regexs . size + 1 elements ( the last one being the remaining once everything was chopped away )
# Extract the matched string and chop the rest_of_query
rest_of_query
regexs