正则表达式就是一个用来描述字符模式的对象。它被用来在文本中执行模式匹配(pattern-matching)以及”查找-替换”(search-and-replace)的任务。javascript中正则的风格类似Perl中正则的风格。创建var reg = new RegExp(pattern,modi...
分类:
编程语言 时间:
2015-05-20 17:43:08
阅读次数:
151
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th...
分类:
编程语言 时间:
2015-05-14 18:21:58
阅读次数:
152
https://leetcode.com/problems/wildcard-matching/Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Mat...
分类:
其他好文 时间:
2015-05-09 21:54:23
阅读次数:
206
这是一个挺能展现Scala编程方式的例子,对正在熟悉Scala这门语言的开发者很有帮助。Representing JSON用Scala来表达JSON(Java Script Object Notation)结构,{
"firstname" : "John",
"lastname" : "Smith",
"address" : {
"street" : "21 2nd Street...
分类:
Web程序 时间:
2015-04-26 19:48:43
阅读次数:
201
6 命名约定 Naming
最重要的一致性规则是命名管理govern naming; 命名风格快速获取名字代表是什么: 类型? 变量, 函数, 常量, 宏, ...甚至不需要去查找类型声明; 大脑中的模式匹配引擎pattern-matching engine可以非常可靠的处理这些命名规则;
命名规则具有一定随意性, 但相比按个人喜好命名, 一致性更重要, 所以不管你怎么想, 规则总归是...
分类:
其他好文 时间:
2015-04-20 13:15:59
阅读次数:
199
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including th...
分类:
其他好文 时间:
2015-04-08 06:33:45
阅读次数:
123
Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single character.'*' Matches any sequence of characters (including the e...
分类:
其他好文 时间:
2015-04-07 07:09:42
阅读次数:
441
模式匹配(Pattern Matching)是F#中非常好用的一种语言特性。估计很多人都希望在C#中能用到这样的特性。 一句话解释一下模式匹配就是:创建一个函数可以接受和处理不同类型的表达式(包括不同参数及类型)。比如你写了一个名为format的函数,可以处理表达式“x?(1+2)”中的变量、常量、...
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cove...
分类:
其他好文 时间:
2015-04-02 15:13:28
阅读次数:
111
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover t...
分类:
其他好文 时间:
2015-03-06 11:21:20
阅读次数:
168