码迷,mamicode.com
首页 >  
搜索关键字:match    ( 5193个结果)
正则匹配指定字符之间的内容,并替换(多个匹配替换)
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
常用的正则规则,直接copy就OK了
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
python编写执行指定路径下的hotup.sh脚本
#!/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
ES6正则拓展
字符串的正则方法 字符串对象共有 4 个方法,可以使用正则表达式:match()、replace()、search()和split()。 ES6 将这 4 个方法,在语言内部全部调用RegExp的实例方法,从而做到所有与正则相关的方法,全都定义在RegExp对象上 String.prototype. ...
分类:其他好文   时间:2018-07-10 21:33:43    阅读次数:146
HDU 2426 Interesting Housing Problem(二分图最佳匹配)
http://acm.hdu.edu.cn/showproblem.php?pid=2426 题意:每n个学生和m个房间,现在要为每个学生安排一个房间居住,每个学生对于一些房间有一些满意度,如果满意度为负就说明该学生不喜欢住在这房间。现在问如何安排可以使所有学生的满意度总和最大。(不能将学生安排到他 ...
分类:其他好文   时间:2018-07-10 20:13:03    阅读次数:167
/etc/postfix下 main.cf 配置文件详解
转自: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
C# 过滤特殊字符,保留中文,字母,数字,和-
#region public static string FilterChar(string inputValue) 过滤特殊字符,保留中文,字母,数字,和- /// <summary> /// 过滤特殊字符,保留中文,字母,数字,和- /// </summary> /// <param name= ...
分类:Windows程序   时间:2018-07-09 13:32:26    阅读次数:184
获取地址栏后面的参数值
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
match
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!