b*****n 发帖数: 2324 | |
|
x*z 发帖数: 1010 | 10 对啊,就是在请教这个regexp怎么写啊。按我的想法就得
两步,第一步先regexp去match [],然后再处理剩下的,
不过我python很弱,所以问问有没有什么好办法。 |
|
x*z 发帖数: 1010 | 11 嗯,谢谢,这也是一个思路,不过这个regexp有个小问题,唯一的判定点是要求'.',
这个不是一定的,比如'foo',我也需要它。如果把‘r"\." #dot’从re里拿掉,整个
regexp就不成立了。 |
|
e*******o 发帖数: 4654 | 12 二爷的帖子就像一朵鲜花盛开在牛粪堆上。
我们的一个test 跑不过了,我追踪到了perl的一个parsing module, Regexp::
Grammars
https://metacpan.org/pod/Regexp::Grammars
这花两天时间复习了一下,把bug 挑了出来,然后汇报给作者(Perl 大牛)。他当天就
给fix了。
准备把parse 好好搞一下。 二爷有没有啥推荐? |
|
|
n*****t 发帖数: 22014 | 14 实话实说,我这人真有洁癖。这洁癖倒不是见不到排泄系统,是对语言文字的规范要求
,俗称文青冰,或者深井冰。
举个例子,我下载 txt 小说,第一件事就是重新排版分段落,然后 regexp 删除广告
、三链 |
|
a****r 发帖数: 12375 | 15 这是典型的上海男人,前戏做得一丝不苟,到真枪实干的时候就滑精了。
实话实说,我这人真有洁癖。这洁癖倒不是见不到排泄系统,是对语言文字的规范要求
,俗称文青冰,或者深井冰。
举个例子,我下载 txt 小说,第一件事就是重新排版分段落,然后 regexp 删除广告
、三链 |
|
n****j 发帖数: 1708 | 16 这通稿早写好了,只不过每次出事的时候拿出来 regexp replace 一下 |
|
|
l**********9 发帖数: 537 | 18 请教一下,这个打印什么:
System.out.println("Java".replaceAll("\w*", "RX"));
为什么是2个RX,而不是一个RX, 谢了 |
|
|
l**********9 发帖数: 537 | 20 yes, it is \w*
System.out.println("Java".replaceAll("\w*", "RX")); |
|
l**********9 发帖数: 537 | 21 mitbbs 没做\符号的处理,需要打"\\"才出"\" |
|
|
r**u 发帖数: 1567 | 23 【 以下文字转载自 Linux 讨论区 】
发信人: raou (raou), 信区: Linux
标 题: grep + perl regular expr
发信站: BBS 未名空间站 (Thu Feb 25 16:08:55 2010, 美东)
想用grep+perl regular expression在文件里找一些东西,但是遇到这个问题。如何解
决?多谢
grep: Support for the -P option is not compiled into this --disable-perl-
regexp binary |
|
D****6 发帖数: 278 | 24 第一次:
why Amazon
why good fit
find the min in an array. (coding, read to him)
find the first k smallest in an array.
how to implement arraylist
explain consistent hashing, what is the disadvantage
sth about how to grep some information from a log file, don't remember
details
第二次:
design a generic tree API
design html classes. how to use the tree API to create html tree
regexp to grep phone numbers from files
what is overwriting, overloading, inheritance, delegation, interface
what needs improveme |
|
|
|
r********g 发帖数: 1351 | 27 有的是我面的,有的是听来的。。。detail我也不知道(或者没弄明白),大家自由发
挥吧。。
最讨厌的是开放题,实在无从下手(如果事先没准备的话)
1. 数据结构for spreadsheet
2. 实现 G+ search
3. 一个app需要用cache,怎么实现thread safe
老题:
找minimum snippet (这个很诡异,据说它家的答案是把每个character的index找出来)。
找regexp (含有*和.两个特殊字符,这个递归吧?) |
|
d*******n 发帖数: 124 | 28 我想找一个google search offline的工具,可以基于keyword search 我的document。
可是google desktop discontinue了,还有没有alternative呢。
P.S.不是类似document内部和eclipse内部的那种基于keyword或regexp的search,因为
那些都是hard match而不是soft match。 By soft match, I mean using LCS. |
|
l*n 发帖数: 529 | 29 csv要么用apache的csv库,要么就直接regexp吧。 |
|
|
|
s*****i 发帖数: 3762 | 32 老卡,不要拿这么简单的regexp来哄骗小盆友啊 |
|
n*****t 发帖数: 22014 | 33 好像是手贱从 5 升到 6 还是 7,注册码不好使了,当时正好在做有点沾边的玩意,这
种 regexp 的东西程序搞搞更方便 |
|
l**n 发帖数: 7272 | 34 虽然这里的码工比较少,但是能appreciate coding和programming的朋友也可以看看。
我觉得挺有意思的。
http://blog.sina.com.cn/s/blog_5d90e82f01014k5j.html
我想通过这篇文章解释一下我对 Unix 哲学本质的理解。我虽然指出 Unix 的一个设计
问题,但目的并不是打击人们对 Unix 的兴趣。虽然 Unix 在基础概念上有一个挺严重
的问题,但是经过多年的发展之后,这个问题恐怕已经被各种别的因素所弥补(比如大
量的人力)。但是如果开始正视这个问题,我们也许就可以缓慢的改善系统的结构,从
而使得它用起来更加高效,方便和安全,那又未尝不可。同时也希望这里对 Unix 命令
本质的阐述能帮助人迅速的掌握 Unix,灵活的应用它的潜力,避免它的缺点。
通常所说的“Unix哲学”包括以下三条原则[Mcllroy]:
一个程序只做一件事情,并且把它做好。
程序之间能够协同工作。
程序处理文本流,因为它是一个通用的接口。
这三条原则当中,前两条其实早于 Unix 就已经存在,它们描述的其实是程序设计最... 阅读全帖 |
|
t*******d 发帖数: 1530 | 35 you can use this one for frontend email string validation using javascript,
or backend using asp. php, jsp... whatever.
have tried and worked good so far. feel free to use it and if you find some
error, please tell me.
^([a-zA-Z0-9_&+\/\\-])+([a-zA-Z0-9_&+\/\\\.-])*@([a-zA-Z0-9]([a-zA-Z0-9-]?[a
-zA-Z0-9])*\.)*([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]\.)+[a-zA-Z0-9][a-zA-Z0-9
-]*[a-zA-Z0-9]$ |
|
t*********s 发帖数: 5 | 36
,
some
[a
-9
Don't think you can use this to filter out all email address..
check this page:
http://www.unix.org.ua/orelly/perl/cookbook/ch06_20.htm
Besides, there are many inefficient stuff in your regex pattern.
i.e. in ([a-zA-Z0-9_&+\/\\-])+ , the capturing parenthesis are
not necessary. when matching, that ([...])+ construct makes your
regex engine constantly jump into and then jump out from the
capturing parens, that takes too much unnecessary work and is
highly not recommended. [..]+ is f |
|
|
t*********s 发帖数: 5 | 38
,
some
Some of my comments on your pattern:
this sub-pattern tells me that the username:
1) can be alphanumeric, any of the following grahpic
chars: _ & + / \ - .
2) must not be empty
3) must not begin with the dot '.'
The following is enough for that purpose:
[a-zA-Z0-9_&+\/\\-][a-zA-Z0-9_&+\/\\\.-]*
or if the engine supports look-around constructs:
(?!\.)[a-zA-Z0-9_&+\/\\\.-]+
Looks like the name of the hosts follows the following rules:
1) formed by alphanumberics, dot or dash
2) if |
|
|
L****i 发帖数: 94 | 40 我也来贡献一个:
^[A-Za-z0-9._-]+@[A-Za-z0-9._-]+\.(?:[A-Za-z]{2}|COM|ORG|MIL|NET|BIZ|INFO|
NAME|AERO|BIZ|INFO|JOBS|MUSEUM|NAME|com|org|mil|net|biz|info|name|aero|biz|
info|jobs|museum|name)$ |
|
|
s****y 发帖数: 983 | 42 没有,用证则吧
WHERE ### REGEXP '^[[:digit:]]+$' |
|
|
l******t 发帖数: 108 | 44
don't like to compile frequently.
i still think it is great to have auctex+reftex combo:
* regexp search for references, mark the ones that i wanted, and add
keys into \cite{}.
* when cursor being moved to a citation key, mini buffer shows a brief
info. about the entry.
...
to be completed :) |
|
x******t 发帖数: 6 | 45 查了篇文章Loop-Free Alternating Finite Automata,清楚了。
LTL的表达能力与star-free regular expression相同。所谓的“star-free的regexp语
言”虽然不含有*,却包含negation和intersection,因此它可以表达某些无限长的串。 |
|
|
|
B*****g 发帖数: 34098 | 48 可惜不是oracle,要不也许可以用regExp |
|
x*********n 发帖数: 28013 | 49 连个sh int ip bri都没有?
打出来居然是个提示符,说要你用pipe,然后grep regexp。。。
我晕倒了,还以为是linux玩管理呢。。 |
|
s*****g 发帖数: 1055 | 50 No, it won't work, regexp ^31969$ won't match as-path with multiple 31969 in
it, you probably need a combination of filter-list and prefix-list in this
case, something like ^31969_[31969]*$ and only allow legitimate prefixes to
come in from this AS.
So a side question, does anybody here have tier-1 ISP operation experience?
how does a typical tier-1 ISP configure their BGP filters to block illegal
advertisement from a peer or a customer? do they participate RPKI? if so,
dothey use some kind of ... 阅读全帖 |
|