[Regex Expression] Confirmative -- World bundry
String to check:

As it turns out, our potential shipmates are extremely superstitious. As such, we do not want anyone to enter certain words in their comments.
Requirements:
1. Let's start checking for bad words within a sentence. We can begin with 'sink'as our first bad word. We will want to make sure this word is by itself and not part of a larger word.
/\bsink\b/gim

2. Looking good, but there are more bad words we need to account for. Let's also check for 'wreck'.
/\b(sink|wreck)\b/gim

3. Almost finished. Our final bad word to match is 'disaster'.
/\b(sink|wreck|disaster)\b/gim

-------------------------------------
/http(s)?:\/\/(www\.)?twitter(\.com|\.org)\/codeschool/gm

[Regex Expression] Confirmative -- World bundry的更多相关文章
- Regex Expression的资料和笔记整理
维基百科:http://en.wikipedia.org/wiki/Regular_expression 正则表达式在线测试:http://tool.chinaz.com/regex/ 正则表达式,常 ...
- [Regex Expression] Find Sets of Characters
Regular Expression Character Classes define a group of characters we can use in conjunction with qua ...
- boost regex expression
Boost.Regex provides three different functions to search for regular expressions 1. regex_match #inc ...
- [Regex Expression] Use Shorthand to Find Common Sets of Characters
In this lesson we'll learn shorthands for common character classes as well as their negated forms. v ...
- URL Regex expression
转载: http://blog.csdn.net/weasleyqi/article/details/7912647 首先,正则表达式: String check = @"((http|ft ...
- [Regex Expression] Tagline --- {0, } {1,10}
Using a character set repeated 1 or more times, make a pattern to search for strings that do not con ...
- [Regex Expression] Match mutli-line number, number range
/^-?\d{,}\.\d+$/gm
- java Suspicious regex expression "." in call to 'replaceAll()' 问题延展
因为要处理从身份证读取到的有效期时间,所以用到了replaceAll这个方法,类似如下代码: String s1 = s.replaceAll(".", "-" ...
- 用Regex类计算一个字符串出现次数是最好方法【转载】
我的一个朋友问我,怎么在c#或vb.net中,计算一个字符串中查找另一个字符串中出现的次数,他说在网上打了好多方法,我看了一下,有的是用replace的方法去实现,这种方法不是太好,占资源太大了.其实 ...
随机推荐
- [MongoDB] Remove, update, create document
Remove: remove the wand with the name of "Doom Bringer" from our wandscollection. db.wands ...
- 8个常用的Android开发工具
周末发现一些比较有用的android开发常用的工具,里面大部分是自己经常用的,还有一些暂时很少用,暂且在这里记录下,以后一定同样会经常用到的. 1 The SDK and AVD Manager 这个 ...
- CentOS7--Xshell网络中断引起的vi编辑文件问题
在编写Python的程序时,由于不小心触碰网线使xshell出现网络中断问题,当再次以vi命令打开文件准备编辑时,发现爆出英文错误: 该错误的英文翻译大概是(1)另一个程序也在编译这个文件,如果是这样 ...
- 将excel的.xlsx文件转成数据库文件.db的方法
1.下载好工具SQLite Expert Professional 3 ,晚上有很多,自行百度. 2.打开.xls文件,将文件另存为.csv文件.说明一下: 可以将xls文件看作是数据库里的一个表.所 ...
- C# winForm启动最小化到任务栏右侧通知栏并交互操作
原文链接:http://blog.sina.com.cn/s/blog_45eaa01a01013u36.html C# winForm启动最小化到任务栏右侧通知栏并交互操作 一.主要功能:(1).程 ...
- Apache URL转发
httpd.conf 尾巴加 Alias /web "F:\xampp\htdocs\test/" <Directory "F:\xampp\htdocs\test ...
- 2、 Spark Streaming方式从socket中获取数据进行简单单词统计
Spark 1.5.2 Spark Streaming 学习笔记和编程练习 Overview 概述 Spark Streaming is an extension of the core Spark ...
- (原创) ubuntu 12.04 install nvidia by the deb
先安装 驱动 1. sudo dpkg -i XXX.deb 2. sudo apt-get update 3. sudo apt-get install cuda 4. gedit ~/.bash ...
- Android平台之不预览获取照相机预览数据帧及精确时间截
在android平台上要获取预览数据帧是一件极其容易的事儿,但要获取每帧数据对应的时间截并不那么容易,网络上关于这方面的资料也比较少.之所以要获取时间截,是因为某些情况下需要加入精确时间轴才能解决问题 ...
- html5画饼形图
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm10.aspx ...