- 浏览: 1431136 次
- 性别:
- 来自: 苏州
文章分类
- 全部博客 (564)
- 算法 (7)
- 流金岁月 (1)
- Javascript (30)
- actionscript (108)
- as3.0 game (14)
- flex (84)
- fms2 (27)
- 正则表达式 (7)
- 开源组件代码(as3.0) (1)
- Pv3d (13)
- Cairngorm (4)
- vbs (54)
- VB程序设计 (26)
- 计算机应用与维护 (4)
- 职场实用穿衣技巧 (3)
- 历史风云 (15)
- 淡泊明志,宁静致远 (12)
- 情感 (26)
- 杂谈 (41)
- 越南风 (14)
- DirectX (9)
- Dev-cpp (11)
- 回望百年 (2)
- 建站经验 (2)
- Python (24)
- 网络赚钱 (4)
- php (2)
- html (1)
- ob0短址网 (1)
- ob0.cn (1)
- wordpress (1)
- pandas logistic (1)
- haxe (1)
- opencv (1)
- 微信小程序 (3)
- vue (3)
- Flutter (1)
最新评论
-
GGGGeek:
第一个函数滚动监听不起作用,onPageScroll可以
微信小程序--搜索框滚动到顶部时悬浮 -
naomibyron:
解决办法:工具 -> 编译选项 -> 编译器 ...
dev-c++中编译含WINSOCK的代码出现错误的解决方法 -
haichuan11:
这个…… 代码不全真的是让人很憋屈的感觉啊
actionScript 3.0 图片裁剪及旋转 -
chenyw101:
老兄能留个QQ号吗?具体的我有些东西想请教下你
用VB制作网站登陆器 -
yantao1943:
貌似有点问题,只派发一次事件啊
使用ActionScript 2.0或ActionScript 3.0处理音频文件的提示点(cue
Function bTest(ByVal s As String, ByVal p As String) As Boolean
Dim re As RegExp
Set re = New RegExp
re.IgnoreCase = False '设置是否匹配大小写
re.Pattern = p
bTest = re.Test(s)
End Function
Function StrReplace(s As String, p As String, r As String) As String
Dim re As RegExp
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = p
StrReplace = re.Replace(s, r)
End Function
Function getEmail(ByVal s As String)
Dim re As RegExp
Dim mh As Match
Dim mhs As MatchCollection
Dim temp As String
Set re = New RegExp
re.Global = True
re.Pattern = "(\w)+[@](\w)+[.](\w)+"
If re.Test(s) = False Then Exit Function
Set mhs = re.Execute(s)
For Each mh In mhs
'Debug.Print mh.SubMatches(0)
'Debug.Print mh.Value
temp = mh.Value + temp
Next
getEmail = Trim(temp)
End Function
Function build(ByVal s As String)
Dim email As String '字符串
Dim temp As String
Dim p As String '正则表达式
Dim r As String '要替换的字符串
email = getEmail(s)
's = "我的E-mail: test@163.com 。欢迎致电!"
'p = "w+@w+.w+"
'r = "test@sohu.net"
temp = Replace(s, email, ",")
temp = Trim(temp) + "," + email
temp = Replace(temp, vbCrLf, "")
If temp = "," Then
'Debug.Print temp
Exit Function
End If
build = Trim(temp)
End Function
Private Sub Command1_Click()
Dim strLine As String
Dim strValue() As String
Dim p As String
Dim temp As String
Dim LineCount As Integer '行数
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(App.Path + "\testfile.csv", True)
temp = "姓名,email"
a.WriteLine (temp)
temp = ""
p = "(\w)+[@](\w)+[.](\w)+"
LineCount = 0
Open App.Path + "\test.txt" For Input As #1
Do While Not EOF(1)
LineCount = LineCount + 1
Line Input #1, strLine
If LineCount > 2 Then
If bTest(strLine, p) Then
a.WriteLine (Trim(temp + "," + strLine))
temp = ""
Else
temp = temp + strLine
End If
'Debug.Print strLine
'strValue = Split(strLine, vbTab, , vbTextCompare)
'||……
'||向数据库中增加一条记录,相应字段的值分别为
'||strValue(0)、strValue(1)、strValue(2)、strValue(3)
'||……
End If
Loop
Close #1
a.Close
End Sub
Private Sub Command2_Click()
Dim strLine As String
Dim strValue() As String
Dim temp1 As String
Dim LineCount As Integer '行数
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(App.Path + "\testfile.csv", True)
temp1 = "姓名,手机,email"
a.WriteLine (temp1)
temp1 = ""
LineCount = 0
Open App.Path + "\163txt.txt" For Input As #1
Do While Not EOF(1)
LineCount = LineCount + 1
Line Input #1, strLine
If LineCount > 2 Then
temp1 = build(strLine)
If temp1 = "" Then
Else
a.WriteLine (temp1)
End If
End If
Loop
Close #1
a.Close
End Sub
发表评论
-
wxpython学习笔记
2011-01-13 21:21 1993出处:http://www.cnblogs.com ... -
ADO编程实用宝典
2009-05-08 13:05 1443目录 ADO编程实用宝典 目录 一引入A ... -
创建ACCESS的存储过程
2008-09-11 22:52 4764在Access自身的帮助中看到了Create Procedu ... -
实现服务器端的多线程SOCKET Server
2008-09-11 16:45 3379实现服务器端的多线程SOCKET Server 想要实现 ... -
轻量级xml读写模块 tinyXML
2008-09-11 16:32 2861文档和使用例子: http://www.grinningl ... -
基于TinyXML的XML文档操作(部分测试代码)
2008-09-11 16:31 2401#include <stdio.h> #incl ... -
使用tinyxml类解析XML
2008-09-11 16:26 2416读取和设置xml配置文件是最常用的操作,试用了几个C++的XM ... -
用VB制作网站登陆器
2008-08-25 20:59 4057Private Sub Command1_Click() Wb ... -
vb+Webbrowser控件详解
2008-08-25 20:54 3260方法 说明 GoBack 相当 ... -
VB自动提交表单问题
2008-08-25 14:32 2434需要知道表单名称呢,比如 <Form name=&quo ... -
BBS灌水机脚本(vb scritp, telnet, bbs, sterm)
2008-08-16 11:32 2489'****************************** ... -
c++下载网页的代码,VC6.0编译通过
2008-05-30 19:21 3826#include <winsock2.h> ... -
【译】C/S 多线程Socket类
2008-05-30 19:16 1641Multi-threaded Client/Server So ... -
C++ Socket Class for Windows
2008-05-30 18:59 1608Here, I present the source c ... -
C++ socket程序
2008-05-30 17:58 11482C++ socket程序 下面是一个C++调用windows ... -
VB用正则表达式提取网页中的链接
2008-05-05 10:37 2858VBScript code Function getUrl ... -
利用VB提取HTML文件中的EMAIL地址
2008-05-05 09:53 1167电子邮件(EMAIL)是INTERNET上应用最广泛的一种服务 ... -
VB6.0如何使用正则表达式
2008-05-04 20:39 7952最近在用VB6解决一个网页解析的应用,涉及到了正则。如何在VB ... -
VB写一个IE插件
2008-05-04 18:20 2990Q: 就类似于3721的插件一样,当用户浏览我的网站的时候,提 ... -
破解VisualStudio2005(vs2005) 的180天限制
2008-04-19 11:53 4509中文版本的软件本身是正式版,但内置的序列号却是180天试用版的 ...
相关推荐
字符串提取(获取两个字符串中间的字符串) http://blog.csdn.net/isaced/archive/2011/01/24/6161259.aspx
C# 字符串 提取 分割 源程序 需要点积分,望大家见谅
VBA示例之 从字符串提取纯数字,供初学者参考,大牛勿进~~~~~~~
将数字从字符串中提取,源码 已运行无错,可直接使用
charat 方法是 JavaScript 中一种用于从字符串提取特定字符 的函数,它能够从指定位置获取给定字符串中的字符。它返回一个 字符,没有任何参数时返回空字符串,所以你可以检查字符串的长 度来确定是否已经获取到数据...
bat文件 字符串提取以及替换等操作 在dos窗口下运行 供学习参考
Excel用函数在Excel中从文本字符串提取数字[定义].pdf
字符串读取库函数,字符串读取库函数,字符串读取库函数。
cad 字符串里自动提取数字求和,过滤掉文字,字符等无用的东西,,找了半天才找到这个,而不是那些无用的纯数字求和lsp程序,比如cad画系统图,从各种英文中文语句里提取数字相加,这就是你想要的
Excel用函数在Excel中从文本字符串提取数字.pdf
自己写的字符串截取,很灵活,很好用。你也可以自己修改。
获取一个字符串中的数字组 /*输入一个字符串,内有数字和非数字字符,如a123x456_17960? 302tab5876,将其中连续的数字作为一个整数,请统计出一共有多少个整数,输出这些整数,并求出最长的整数的位数。*/
extract-values, 在 Pattern 上,从字符串提取值的简单 helper ExtractValues这是一个简单的helper,它基于 Pattern 从字符串中提取值。示例 extractValues("/2012/08/12/test.html", "/{year}/{month}/{day}/
Delphi 7.0 提取字符串中指定子字符串后的字符串,这个平时在字符处理时候使用几率也挺高的,获取指定字符串后面的字符串,比如获取扩展名等也可以用此方法,本例中要用到After函数,测试时,当单击按钮时,执行以下...
java 利用正则表达式从字符串中提取省、市、区、镇、乡等区域名称(包含少数民族地区),支持地址中无省,无市,无县情况。
用c语言重写字符串功能函数,如字符串替换,即复制; 字符串比较
三菱PLC FX5U 字符串转实数(程序说明)
处理字符串 包括字符串分割 字符串的一些运算
输入字符串取字符串中url中域名 你懂的 下载吧 速度! 诚信可靠!
Excel混合字符串中提取汉字[文].pdf