首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

处置行数据的属性

2012-11-10 
处理行数据的属性?# to change this template, choose tools | templates# and open the template in the

处理行数据的属性
    ?

# to change this template, choose tools | templates# and open the template in the editor.#require 'dbi'reg = [/^([a-z]|[a-z]|\_)+$/,/^([a-z]|[a-z]|\_)+$/,/^(int|varchar|char|float)$/,/^([0-9]|\()/,/\w/]default =['未知列名名','null','int','11','默认为null']file = file.new("test.txt",'w')$stdout = filedef test str  array = []  j = 0  str = str.split  #puts str  for i in (0..4)    if i == 0      unless reg[i] =~ str[j]      array[i] = str[j]      #puts str      #puts "______________"      #i += 1      j += 1      next      end    end    if reg[i] =~ str[j] and i > 0      array[i] = str[j]      #i += 1      j += 1      #next    else      array[i] = default[i]    end  end  arrayendputs "hello" if /^[a-z]+$/ =~ "gisodo"array = test " int  "puts array$stdout = stdoutfile.closeputs "ihgosg" if  /^([a-z]|a-z|\_)+$/ =~ "gsi"
?f ?/^([a-z]|a-z|\_)+$/ =~ "gsi"
 

热点排行