var str="是吗@Test1:我觉得你说的很对@Test:学无止境"; var r=str.match(/@.*?:/ig); for (var index = 0; index "+r[index]+""); } console.log(str); ...
分类:
其他好文 时间:
2018-07-11 19:58:25
阅读次数:
298
import re #用户名验证:(数字字母或下划线6到20位)re.match("/^\w{6,20}$/",匹配对象) #邮箱验证: re.match(" /^[a-z0-9][\w\.\-]*@[a-z0-9\-]+(\.[a-z]{2,5}){1,2}$/i",匹配对象) #密码验证:re. ...
分类:
其他好文 时间:
2018-07-11 17:06:58
阅读次数:
149
#!/usr/bin/envpython#coding:utf-8importosimportreimportsysnum=[]game_gen_path=‘/data/bz-tw-and/‘fordirsinos.listdir(game_gen_path):ifre.match(‘s\d+‘,dirs):num.append(dirs[1:])number=sorted(map(int,num
分类:
编程语言 时间:
2018-07-10 23:35:56
阅读次数:
202
字符串的正则方法 字符串对象共有 4 个方法,可以使用正则表达式:match()、replace()、search()和split()。 ES6 将这 4 个方法,在语言内部全部调用RegExp的实例方法,从而做到所有与正则相关的方法,全都定义在RegExp对象上 String.prototype. ...
分类:
其他好文 时间:
2018-07-10 21:33:43
阅读次数:
146
http://acm.hdu.edu.cn/showproblem.php?pid=2426 题意:每n个学生和m个房间,现在要为每个学生安排一个房间居住,每个学生对于一些房间有一些满意度,如果满意度为负就说明该学生不喜欢住在这房间。现在问如何安排可以使所有学生的满意度总和最大。(不能将学生安排到他 ...
分类:
其他好文 时间:
2018-07-10 20:13:03
阅读次数:
167
转自:https://www.cnblogs.com/qianyuliang/p/6501531.html postconf -n #别名数据库(postalias/newaliases 命令生成) alias_database = hash:/etc/postfix/aliases #别名表,列出 ...
分类:
其他好文 时间:
2018-07-09 23:17:17
阅读次数:
247
#region public static string FilterChar(string inputValue) 过滤特殊字符,保留中文,字母,数字,和- /// <summary> /// 过滤特殊字符,保留中文,字母,数字,和- /// </summary> /// <param name= ...
1.获取地址栏后面某一个参数的值 function GetQueryString(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match( ...
分类:
其他好文 时间:
2018-07-09 12:43:37
阅读次数:
142
#include #include #include #include #include #include using namespace std; int n,m,k,ans,cnt,head[1001],vis[1001],match[1001]; struct uio{ int next,to... ...
分类:
编程语言 时间:
2018-07-08 18:09:34
阅读次数:
178
package com.bjsxt.scala object Lesson_match { def main(args: Array[String]): Unit = { val tuple = (1,"hello",'c',1.0,true) val iter = tuple.productIte... ...
分类:
其他好文 时间:
2018-07-07 22:38:33
阅读次数:
210