[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的方法去实现,这种方法不是太好,占资源太大了.其实 ...
随机推荐
- 基于akka实现简单的主从框架
========================Master============================== package com.scala.akka.rpc.demo2 import ...
- CentOS管理
1.使用yum安装和卸载软件 主要功能是更方便的添加/删除/更新RPM包. 它能自动解决包的倚赖性问题. 它能便于管理大量系统的更新问题 一.yum list|more 列 ...
- 再关于IE11
微软在上周刚刚发布了用于Windows 8.1上的首个Internet Explorer 11的预览版.我们已经确认Internet Explorer 11中的一些新特性,包括对WebGL的支持.预抓 ...
- HTMl5的sessionStorage和localStorage(转)
html5中的Web Storage包括了两种存储方式:sessionStorage和localStorage. sessionStorage用于本地存储一个会话(session)中的数据,这些数据只 ...
- JavaScript split()
http://www.w3school.com.cn/jsref/jsref_split.asp
- Oracle 获取表结构信息
通过Oracle中的user_tab_cols, user_col_comments, user_constraints, user_cons_columns表联合查询. user_tab_cols用 ...
- iOS的Bundle资源束制作
在静态库的制作中,很多时候我们的静态库也是带着文件,图片和多媒体资源的. 若只是直接加入到项目中也是可以,但是,考虑到方便管理(方便插件使用者的管理),我们希望把插件的资源文件打成一个包来管理. 当然 ...
- jquery cookie 删除不了的处理办法
$.cookie(name, null);$.cookie(name, null, {path : "/"}); Jquery Cookie的值直接设置null,并不能直接删除Co ...
- Codeforces Round #302 (Div. 1)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud A. Writing Code Programmers working on a ...
- 锋利jQuery 学习整理之 第六章 jQuery 与Ajax 的应用
1.Ajax 的XMLHttpRequest 对象 XMLHttpRequest 是Ajax 的核心,它是Ajax 实现的关键---发送异步请求.接受响应及执行回调都是通过它来完成的.XMLHttpR ...