<span id="a">jeff@weisbein</span>:<span id="b">~</span><span id="c">$</span> cat jeffweisbein.txt<br/><br/>
Hi, I'm Jeff Weisbein.<!-- laglaglaglaglaglaglaglaglaglaglaglag --><p>I majored in Business Administration with a concentration in Finance. I graduated Summa Cum Laude. I'm currently enrolled in the <a href="https://analytics.hbs.edu">Business Analytics Program at Harvard</a>.</p><!-- qowifjqwoeijfoqweijfqweoifjqweofijqweoqwoijefoqwijefoijfqiwoefjj -->
<p>I'm the founder and CEO of <a href="http://www.besttechie.com">BestTechie</a> and <a href="https://getkya.com">KYA</a>.</p><!- oqwipjefqwioefjwioqfjoiqwjfeioqwjefoi -->
<p>I got started with technology at the age of 13 when I convinced my parents to let me use their credit card to buy the BestTechie domain along with some web hosting. I haven't looked back since.</p><!-- owlsqweoifjqwoefijqwoeifjqwoefijwef -->
If you would like to get in touch with me, whether it be for tech support, a business venture, or to just say hi<!-- slightdelayhere-->, feel free to send me an email or a tweet.<!-- longlongcomment --> My email address is: <a href="mailto:jeff@besttechie.com">jeff@besttechie.com</a> and my Twitter is: <a href="http://twitter.com/jeffweisbein">@jeffweisbein</a>.
<p>And if you haven't already, be sure to check out my tech publication <a href="http://www.besttechie.com">http://www.besttechie.com</a> and analytics startup <a href="https://getkya.com">https://getkya.com</a>.</p>
官网上对JS/UIX 的介绍:”JS/UIX is an UN*X-like OS for standard web-browsers, written entirely in JavaScript (no plug-ins used). It comprises a virtual machine, shell, virtual file-system, process-management, and brings its own terminal with screen- and keyboard-mapping.”
select 字段列表 from 表名 where 字段 [not] regexp [binary] ‘正则表达式’;
用法如下:
select 字段列表 from 表名 where 字段 regexp ‘j.’ ; 表示:查询 j 开头且为两个字符的数据
select 字段列表 from 表名 where 字段 regexp ‘158[0-9]{9}’; 表示:查询 158开头,11位的电话号码
。。。。。。
三、总结
正则表达式的模式匹配比like 运算符的模式匹配更加强大、灵活。
实例:
下面介绍mysql中模糊查询的四种用法:
1,%:表示任意0个或多个字符。可匹配任意类型和长度的字符,有些情况下若是中文,请使用两个百分号(%%)表示。
比如 SELECT * FROM [user] WHERE u_name LIKE ‘%三%’
将会把u_name为“张三”,“张猫三”、“三脚猫”,“唐三藏”等等有“三”的记录全找出来。
另外,如果需要找出u_name中既有“三”又有“猫”的记录,请使用and条件
SELECT * FROM [user] WHERE u_name LIKE ‘%三%’ AND u_name LIKE ‘%猫%’
若使用 SELECT * FROM [user] WHERE u_name LIKE ‘%三%猫%’
虽然能搜索出“三脚猫”,但不能搜索出符合条件的“张猫三”。
2,_: 表示任意单个字符。匹配单个任意字符,它常用来限制表达式的字符长度语句:
比如 SELECT * FROM [user] WHERE u_name LIKE ‘_三_’
只找出“唐三藏”这样u_name为三个字且中间一个字是“三”的;
再比如 SELECT * FROM [user] WHERE u_name LIKE ‘三__’; 只找出“三脚猫”这样name为三个字且第一个字是“三”的;
3,[ ]:表示括号内所列字符中的一个(类似正则表达式)。指定一个字符、字符串或范围,要求所匹配对象为它们中的任一个。
比如 SELECT * FROM [user] WHERE u_name LIKE ‘[张李王]三’ 将找出“张三”、“李三”、“王三”(而不是“张李王三”);
如 [ ] 内有一系列字符(01234、abcde之类的)则可略写为“0-4”、“a-e”
SELECT * FROM [user] WHERE u_name LIKE ‘老[1-9]’ 将找出“老1”、“老2”、……、“老9”;
4,[^ ] :表示不在括号所列之内的单个字符。其取值和 [] 相同,但它要求所匹配对象为指定字符以外的任一个字符。
比如 SELECT * FROM [user] WHERE u_name LIKE ‘[^张李王]三’ 将找出不姓“张”、“李”、“王”的“赵三”、“孙三”等;
SELECT * FROM [user] WHERE u_name LIKE ‘老[^1-4]’; 将排除“老1”到“老4”,寻找“老5”、“老6”、……
5,查询内容包含通配符时
由于通配符的缘故,导致我们查询特殊字符“%”、“_”、“[”的语句无法正常实现,而把特殊字符用“[ ]”括起便可正常查询。据此我们写出以下函数:
function sqlencode(str) str=replace(str,”‘;”,”‘;’;”)
str=replace(str,”[“,”[[]”) ‘;此句一定要在最先 str=replace(str,”_”,”[_]”) str=replace(str,”%”,”[%]”) sqlencode=str end function