boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Fashion版 - 谁会regular expression啊
相关主题
【奔】问题--3楼开始奔连衣裙
哪里能买到弹力素阿?
谁能在costco买到Truffettes de France,求代购阿!!
Clarins官网GWP
大家对这个包有什么想法啊?拔了吗?
自制去黑头面膜
sephora的订单被cancel了。。。
大家帮忙选个男包,前8个有包子(要有原因)
男生怎么带钥匙?
GAP小deal
相关话题的讨论汇总
话题: expression话题: regular话题: size话题: java话题: pockets
进入Fashion版参与讨论
1 (共1页)
Y*******n
发帖数: 4646
1
问个题。。。
给一个字符串。。。比如 this bag has two size L pockets.
this bag has two size medium pockets.
找出size后面的一个单词。
第一个的结果应该是: L
第二个的结果: medium
。。。然后我奔新衣服谢谢大家
I*****e
发帖数: 15123
2
你快奔吧!我县沙发

【在 Y*******n 的大作中提到】
: 问个题。。。
: 给一个字符串。。。比如 this bag has two size L pockets.
: this bag has two size medium pockets.
: 找出size后面的一个单词。
: 第一个的结果应该是: L
: 第二个的结果: medium
: 。。。然后我奔新衣服谢谢大家

Y*******n
发帖数: 4646
3
美女。。现在我焦头烂额的哪有时间奔啊。。。问题答出来了才有时间啊。。

【在 I*****e 的大作中提到】
: 你快奔吧!我县沙发
Y*******n
发帖数: 4646
4
免税日买的这件。。。呵呵。。220-》66刀。。。委屈大家先看模特图。。。我
今天晚上拍个照片传上来。。
n***y
发帖数: 15001
5
my right brain has nothing left...
my left brain has nothing right...
y*e
发帖数: 9799
6
which flavor of RE? in UNIX or Perl?
Y*******n
发帖数: 4646
7
是一个etl软件自己带的。。。我也不知道具体什么flavor的。。也不知道怎么查。。
。但是我知道这个软件是用java写的。。

【在 y*e 的大作中提到】
: which flavor of RE? in UNIX or Perl?
y*e
发帖数: 9799
8
Java's RE is really a piece of shit!!! assuming you're asking for Java RE,
this should work: .*size\s(\S+).*

【在 Y*******n 的大作中提到】
: 是一个etl软件自己带的。。。我也不知道具体什么flavor的。。也不知道怎么查。。
: 。但是我知道这个软件是用java写的。。

l*y
发帖数: 21010
9
/size\W+(\w+)\b/
then $1 is what you want

【在 Y*******n 的大作中提到】
: 问个题。。。
: 给一个字符串。。。比如 this bag has two size L pockets.
: this bag has two size medium pockets.
: 找出size后面的一个单词。
: 第一个的结果应该是: L
: 第二个的结果: medium
: 。。。然后我奔新衣服谢谢大家

Y*******n
发帖数: 4646
10
相关主题
Clarins官网GWP
大家对这个包有什么想法啊?拔了吗?
自制去黑头面膜
sephora的订单被cancel了。。。
进入Fashion版参与讨论
l*y
发帖数: 21010
11
you didn't consider punctuations

【在 y*e 的大作中提到】
: Java's RE is really a piece of shit!!! assuming you're asking for Java RE,
: this should work: .*size\s(\S+).*

Y*******n
发帖数: 4646
12
你看看怎么回事?
把前面部分也Output出来啦。。

【在 l*y 的大作中提到】
: /size\W+(\w+)\b/
: then $1 is what you want

l*y
发帖数: 21010
13
if you want to do substitution, then use this:
s/^.*\bsize\W+(\w+)\b.*/$1/i

【在 Y*******n 的大作中提到】
: 你看看怎么回事?
: 把前面部分也Output出来啦。。

Y*******n
发帖数: 4646
14
只要'large'作为output..
但是这个吧前,后所有的text都output出来了。

【在 l*y 的大作中提到】
: you didn't consider punctuations
Y*******n
发帖数: 4646
15
omg omg omg omg
it worked !!! 厉害。。。谢谢!
可不可以讲解一下?
/b
W+
\w+
都啥意思啊。。

【在 l*y 的大作中提到】
: if you want to do substitution, then use this:
: s/^.*\bsize\W+(\w+)\b.*/$1/i

l*y
发帖数: 21010
16
\b, word boundary
\w, word character
\W, non-word character
+, 1 or more

【在 Y*******n 的大作中提到】
: omg omg omg omg
: it worked !!! 厉害。。。谢谢!
: 可不可以讲解一下?
: /b
: W+
: \w+
: 都啥意思啊。。

l*y
发帖数: 21010
17
please ben a pic that I will like (you got the idea)..

【在 Y*******n 的大作中提到】
: omg omg omg omg
: it worked !!! 厉害。。。谢谢!
: 可不可以讲解一下?
: /b
: W+
: \w+
: 都啥意思啊。。

Y*******n
发帖数: 4646
18
啊呜啊呜。。
穿丝袜啊。。。
老天。。。
呵呵呵呵。。。

【在 l*y 的大作中提到】
: please ben a pic that I will like (you got the idea)..
l*y
发帖数: 21010
19
hehe ,just joking, ben anything you like

【在 Y*******n 的大作中提到】
: 啊呜啊呜。。
: 穿丝袜啊。。。
: 老天。。。
: 呵呵呵呵。。。

Y*******n
发帖数: 4646
20
刚才贴了一个,但是不让link。。显示不了
我今天晚上照写照片吧。。一定补上。。呵呵。。
还有。。忘记问个重要的:
$1是什么意思?

【在 l*y 的大作中提到】
: hehe ,just joking, ben anything you like
相关主题
大家帮忙选个男包,前8个有包子(要有原因)
男生怎么带钥匙?
GAP小deal
how is this purse, and how is L.A.M.B brand
进入Fashion版参与讨论
l*y
发帖数: 21010
21
$1 means the string in the first pair of parentheses
$2 means the string in the second pair.. and so on

【在 Y*******n 的大作中提到】
: 刚才贴了一个,但是不让link。。显示不了
: 我今天晚上照写照片吧。。一定补上。。呵呵。。
: 还有。。忘记问个重要的:
: $1是什么意思?

Y*******n
发帖数: 4646
22
谢谢!
你是主要用什么语言/软件的?

【在 l*y 的大作中提到】
: $1 means the string in the first pair of parentheses
: $2 means the string in the second pair.. and so on

Y*******n
发帖数: 4646
23
{[A-Z0-9-/\#.]{2,20}}
这个能够pick up纯字母的。。。怎么让他exclude纯字母的呢?
可以写很多个regex。。。不一定要一个regex

【在 l*y 的大作中提到】
: $1 means the string in the first pair of parentheses
: $2 means the string in the second pair.. and so on

l*y
发帖数: 21010
24
try this. insert a ^ at the beginning inside the brackets:
{[^A-Z0-9-/\#.]{2,20}}

【在 Y*******n 的大作中提到】
: {[A-Z0-9-/\#.]{2,20}}
: 这个能够pick up纯字母的。。。怎么让他exclude纯字母的呢?
: 可以写很多个regex。。。不一定要一个regex

1 (共1页)
进入Fashion版参与讨论
相关主题
GAP小deal
how is this purse, and how is L.A.M.B brand
Chelsea two-pocket hobo Black
帮选LV包包
One Coach bag comments needed please
coach online sale明天开始。
帮忙看看这几个coach怎么样呢?
两个coach包(二选一)
saks fifth 这件皮衣才$200,请帮忙灭草!!
求推荐包中包
相关话题的讨论汇总
话题: expression话题: regular话题: size话题: java话题: pockets