我正在尝试找到正则表达式来查找字符串中的字母数字单词,即字母或数字组合的单词.如果一个单词是纯数字或纯字符,我需要丢弃它.
这是我想要匹配的模式:
<div class="class">
<a href="http://www.example.com/something"> I want to be able to capture this text</a>
<span class="ptBrand">
Run Code Online (Sandbox Code Playgroud)
这就是我在做的事情:
$pattern='{<div class="productTitle">[\n]<((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)>([^\n]*)</a>[\n]<span class="ptBrand">}';
preg_match($pattern, $data, $matches,PREG_OFFSET_CAPTURE);
print_r($matches);
Run Code Online (Sandbox Code Playgroud)
它打印:
数组()
我正在尝试将IP地址插入LastIP(无符号整数)
INSERT INTO user_entry (UPC, StateID, StoreID,CityID,Price,Count,LastIP) VALUES (885909301378,1,1,1,170,0,INET_ATON(127.0.0.1))
Run Code Online (Sandbox Code Playgroud)
错误:
1064 - 您的SQL语法出错; 检查与MySQL服务器版本对应的手册,以便在第1行使用".0.1))附近的正确语法"