[总结]工作中常用的正则表达式,有了它事半功倍!
2005-10-27 17:27
344 查看
1.给现有的DropDownList添加项目!
例如:
<asp:DropDownList id="ddlF1127" runat="server">
</asp:DropDownList>
文档中有如下信息
1 Own Home Outright
2 Buying Home
3 Living with Relatives or Friends
4 Leasing/Rent
5 Departement housing
6 Aboriginal housing
那么用正则表达式
{:z} {[a-zA-Z:Zs\/]+}
<asp:ListItem Value =\1>\2</asp:ListItem>
可以替换为
<asp:DropDownList id="ddlF1127" runat="server">
<asp:ListItem Value="1">Own Home Outright </asp:ListItem>
<asp:ListItem Value="2">Buying Home </asp:ListItem>
<asp:ListItem Value="3">Living with Relatives or Friends</asp:ListItem>
<asp:ListItem Value="4">Leasing/Rent</asp:ListItem>
<asp:ListItem Value="5">Departement housing</asp:ListItem>
<asp:ListItem Value="6">Aboriginal housing</asp:ListItem>
</asp:DropDownList>
例如:
<asp:DropDownList id="ddlF1127" runat="server">
</asp:DropDownList>
文档中有如下信息
1 Own Home Outright
2 Buying Home
3 Living with Relatives or Friends
4 Leasing/Rent
5 Departement housing
6 Aboriginal housing
那么用正则表达式
{:z} {[a-zA-Z:Zs\/]+}
<asp:ListItem Value =\1>\2</asp:ListItem>
可以替换为
<asp:DropDownList id="ddlF1127" runat="server">
<asp:ListItem Value="1">Own Home Outright </asp:ListItem>
<asp:ListItem Value="2">Buying Home </asp:ListItem>
<asp:ListItem Value="3">Living with Relatives or Friends</asp:ListItem>
<asp:ListItem Value="4">Leasing/Rent</asp:ListItem>
<asp:ListItem Value="5">Departement housing</asp:ListItem>
<asp:ListItem Value="6">Aboriginal housing</asp:ListItem>
</asp:DropDownList>
相关文章推荐
- 工作中常用的正则表达式总结
- 工作中常用的正则表达式总结
- 几个C#常用正则表达式的总结
- C# 中的常用正则表达式总结
- Java学习总结(五)——(常用类,正则表达式,集合(List,Set) 迭代器)
- 【正则表达式图片总结】+常用的表单验证代码
- 工作常用正则表达式
- Java正则表达式常用符号总结
- 常用的正则表达式总结
- javascript正则表达式的常用方法总结
- iOS 常用的正则表达式总结<待更新>
- C# 中的常用正则表达式总结
- 常用正则表达式总结
- 工作中常用的正则表达式
- 黑马程序员--Java常用正则表达式学习及总结
- C# 中的常用正则表达式总结
- 常用正则表达式总结
- Python正则表达式常用函数总结
- C# 中的常用正则表达式总结
- C# 中的常用正则表达式总结