|
e*******o 发帖数: 4654 | 2 ^ 的意思是在\n 之后。 $的意思是在\n之前。
a\n\n\nb
a\n 不match:
\s* 吃掉\n\n,后面是b,不行,吐出一个\n,match1次,吐出n后,前是\n,后面\n,
又match 一次,一共match两次。
a\n\n\n\s\nb:
\s* 吃掉\n\n\s\n,后面是b,不行,吐出一个\n,match1次,吐出n后, 前面是\s, 不
行, 剩下的一个n不match。一共match一次。
水平比较次,不知道说清楚没有。
用这个
https://metacpan.org/pod/Regexp::Debugger
rxrx your_scripts.pl
然后 按n,可以看动态的看怎么匹配的。 |
|
n*****t 发帖数: 22014 | 3 最终 ASIC 还是 FPGA 其实无所谓,软件硬件化其实一直有人在玩,FPGA 做印证还是
不错的。有些功能比较固定的操作,比如 strcmp, regexp 做成 ASIC 比较合适,另一
些比如 SQL/XML parser 可能 FPGA更适合,因为语言可能会变。
总之,DataPU 说不定是个很好的市场 |
|
n*****t 发帖数: 22014 | 4 要我就去,玩些你们不会的,彰显一下,哈哈
其实我觉得以后一部分 lib 都可以写到 FPGA 里了,或者 DB index/search/pattern
match 这类,想想多爽啊,regexp match 就是传 2 个指针给 IO 。。。。特别适合
big data |
|
n*****t 发帖数: 22014 | 5 新面试题:regexp replace 中文数字 |
|
|
d****n 发帖数: 1637 | 7 我用的是beego,比起martini,beego 有偏好,但是有orm.我可没那能力和时间自己造
一个轮子。
martini 我感觉有两点好的,
1. router 是tree的,支持很好的regexp, query parsing也很standard
beego 的太简单,太少doc
2.http.Hanlder 和 golang的compatible. func fn(request, response)
beego的只用 一个struct (beego.Controller) 传来穿去,很难refactor 或者
intercept
beego 有自己的middleware装法,但是不标准, 要follow it.
public的middle ware 都支持标准 handler singnature.
matini不好的就是要自己装orm,感觉好多人自己加装gorm。
我只有用RDBMS 的经验。没用国 noSQL, (听说golang支持mongodb也不错)
golang 自己家的rethingDB 也很好,但是太新了。一次update 就改动了2000多个
featur... 阅读全帖 |
|
|
|
|
|
n*****t 发帖数: 22014 | 12 All links 是 html tag,楼上提到的是用 jquery,email 是典型的 regexp |
|
e*******o 发帖数: 4654 | 13 就是弄个dsl 嘛
Perl
regexp::grammar
或者 marpar
各种语言都有类似的
跟你说了 一开始 完全没必要搞这个 先手动弄好再说 |
|
c****n 发帖数: 89 | 14 you can surely use key-boards. that's just easy in Editplus.
it even spt regexp, hehe... |
|
w*****n 发帖数: 94 | 15 I don't know in which way you want to read/edit it. If you wanna
1) do minor changes on head or tail part
use head or tail to cut part of it, do the edit, then paste back;
2) do regular changes on whole file
use sed/awk/perl and REGEXP
3) search information
use grep
4) read page by page?
more |
|
w*****n 发帖数: 94 | 16 if vi does not support non-greedy regexp, try to use
[\w]* or [a-zA-Z0-9]* or [^%]* instead of .* |
|
O*D 发帖数: 17 | 17 Hi all,
I have a question about XEmacs lisp extension.
In C++-mode, font lock recognizes int, float etc as types and highlight
them using font-lock-type-face. Yet it does not font lock on extended types
for instance time_t and iterator.
Emacs fontifies these names by default and one can append whatever he wants
to the list c++-font-lock-extra-types. And if your company decided all the
classes in its application code would conform to a name convention class
TC***,
you can add a regexp to the list |
|
F**e 发帖数: 593 | 18 what's the regular expression for "not contaning colon", for which
the following will return 1:
aabbcc
and the following will return 0:
aabb:cc
Thanks. |
|
w*******g 发帖数: 51 | 19 /[^:]/g, well, following perl convention. |
|
o***z 发帖数: 133 | 20 把match "containing colon"的结果反一下成不? |
|
F**e 发帖数: 593 | 21 How to invert?
"match colon" would be "[:]", but "[^:]" returns 1 in both cases. |
|
p******f 发帖数: 162 | 22
if perl, you can say,
$_ !~ /:/;
or
$_ =~ /^[^:]*$/; |
|
o***z 发帖数: 133 | 23 change 'if' to 'unless'? |
|
p****s 发帖数: 3184 | 24
Regexp matching is greedy, that is, it will try to match
the longest pattern.
Thus, "^(.+) +" matches "one two ", and $1 is "one two".
The next "(.+)" matches "three", and $2 is "three". |
|
w*******o 发帖数: 32 | 25
M-<
M-x replace-regexp $ aaa |
|
d****p 发帖数: 685 | 26 Use RegExp.
You may try the following code:
my $string = "ABCDDDEEDDABDDEAAB";
my $count = 0;
while ($string =~ s/AB//) {$count++}
print $count; |
|
|
y**x 发帖数: 117 | 28 I actually can use read.table function in R. I am trying to learn Matlab
now. I think even in Matlab I also can use regexp to solve it. But it will
be slow to read large text file with such format, I guess. |
|
f***a 发帖数: 329 | 29 譬如说怎么在R中自动连接下面这个网址然后把data剥离出来。
http://finance.yahoo.com/q/hp?s=IBM
我知道在matlab里面怎么弄,不知道R里面是不是弄起来也不难。
matlab的话,主要就是用两个function: urlread用来retrieving the webpage,
regexp用
来extracting the date field.
不只谁有经验在R里面怎弄,望不吝赐教,呵呵~ |
|