Redian新闻
>
Regular Expression question: how to enumerate all matches? (转载)
avatar
Regular Expression question: how to enumerate all matches? (转载)# Linux - Linux 操作系统
h*i
1
I have a web design project and needs a quote for the price. If interested,
please contact me at s*****[email protected]
Thanks.
avatar
a*w
2
☆─────────────────────────────────────☆
xiaoshuai (小帅) 于 (Sat Aug 16 23:58:37 2008) 提到:
国内的时候,我和我老婆都是税后20万一年。没觉怎么好。上班路途远,加班加的人崩
溃。没时间花钱,存款倒是长得很快,就看银行存折蹦字了。
注意,我们两个为了奋斗到这样的工资都花了3-4年的时间。而且两个人都是国内名校
毕业的硕士,都进了最顶尖的公司。
我不否认,和很多人比,我们工资并不算高,但是那些人也都付出了更多的努力和时间
。想回国赚钱没有错,但是还是要做好相当的思想准备。
对我来说,那四年的辛苦程度,足够我在美国拿两个PhD.
还有一部分人说自己在国内赚多少多少,很多是不稳定的,靠天吃饭。年景好就多,不
好的时候她没告诉你。我想要是几年之内每年平均赚20万,对于打工的来说,绝对没那
么容易。
☆─────────────────────────────────────☆
mryangxiao (mryangxiao) 于 (Sun Aug 17 00:13:46 2008) 提到:
中国要
avatar
a*8
3
收到打手印的通知,因为出差,是否可以直接提前去local的USCIS 去打手印? 还是要
make an appointment first?
因为没人看孩子,是否可以带小孩一起去?
谢谢
avatar
G*a
4
【 以下文字转载自 Java 讨论区 】
发信人: GreenPapaya (为什么我是我 [请勿置顶]), 信区: Java
标 题: Regular Expression question: how to enumerate all matches?
发信站: BBS 未名空间站 (Tue May 26 07:46:13 2009)
I want to obtain all the possible matches of "a" from aaaaa, that should be:
a
aa
aaa
aaaa
aaaaa
but 'a+' does not do the the job, it only returns the longest match "aaaaa".
how can i get all the possible matches enumerated? Thanks!
avatar
m*t
5

be:
".
I don't think you can come up with one regex to get them all.
You could construct "a{i}" dynamically where i steps from 1 to 5. Or take
substrings of "aaaaa" and try matching each of them against "a+"
But what exactly are you trying to achieve?

【在 G*********a 的大作中提到】
: 【 以下文字转载自 Java 讨论区 】
: 发信人: GreenPapaya (为什么我是我 [请勿置顶]), 信区: Java
: 标 题: Regular Expression question: how to enumerate all matches?
: 发信站: BBS 未名空间站 (Tue May 26 07:46:13 2009)
: I want to obtain all the possible matches of "a" from aaaaa, that should be:
: a
: aa
: aaa
: aaaa
: aaaaa

avatar
r*n
6
in vim, you just use the option of g[lobal]
like this.
it will put each matches in a single line,
and then you can move them to the end of file
by this:
be:
".
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。