_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › RegularExpressions

Contents

1 一危 伎 螳 觸願鍵
2 蠏語 覓語 觸願鍵
3 蠏語 觸願鍵
4 SQL ろ襴渚語 insert 企 谿剰鍵
5 ろる.企
6 轟 覓語企 觸願鍵
7 html 蠏碁 觸願鍵
8 一危 覓語 蟲覿 csv
9 覦一(array)
10 覃覓語
11 蠍磯蓋 襷れ広
12 谿瑚


windows7 蟆曙企.
[http] 蟠朱 企 蠏, 螻企襯伎/ろ磯 襴覦伎 襴 覲碁.

.Net 蠍一朱 .

1 一危 伎 螳 觸願鍵 #


"aaa"bbb ccc 
ddd"fff"


(?<=\")(.*?)(?=\")

蟆郁骸
aaa
fff

2 蠏語 覓語 觸願鍵 #


<PackageName>aaa.dtsx</PackageName>
<PackageName>aaa.txt</PackageName>
<PackageName>aaa.dtsx
<PackageName>aaa.dtsx</aaaPackageName>
<html>aaaa bbb </html>


(?<=\<PackageName\>)[\w./]+\.dtsx(?=\<\/PackageName\>)

蟆郁骸
aaa.dtsx


るジ

<Cars>
  <Car id="1234">
     <Make>Volkswagen</Make>
     <Model>Eurovan</Model>
     <Year>2003</Year>
     <Color>White</Color>
  </Car>
  <Car id="5678">
     <Make>Honda</Make>
     <Model>CRV</Model>
     <Year>2009</Year>
     <Color>Black</Color>
     <Mileage>35,600</Mileage>
  </Car>
</Cars>


<Car[\n\s\S]*?</Car>

蟆郁骸
<Cars>
  <Car id="1234">
     <Make>Volkswagen</Make>
     <Model>Eurovan</Model>
     <Year>2003</Year>
     <Color>White</Color>
  </Car>
  <Car id="5678">
     <Make>Honda</Make>
     <Model>CRV</Model>
     <Year>2009</Year>
     <Color>Black</Color>
     <Mileage>35,600</Mileage>
  </Car>

3 蠏語 觸願鍵 #



<html><img src="kk.gif" alt="text"/></html>
<html><img src='kk.gif' alt="text"/></html>
<html><img src = "kk.gif" alt="text"/></html>


<img[^>]+src\s*=\s*['"]([^'"]+)['"][^>]*>

蟆郁骸
<img src="kk.gif" alt="text"/>
<img src='kk.gif' alt="text"/>
<img src = "kk.gif" alt="text"/>

4 SQL ろ襴渚語 insert 企 谿剰鍵 #

text
insert into	 [dw].[fact].[conn_users]
insert into [Fact].conn_users
insert into Fact.conn_users
insert into fact.conn_users
insert into	 dw.fact.conn_users
insert into	 [dw].fact.[conn_users]
insert into	 [dw].fact.[Conn users]
insert into
fact.conn_users
insert fact.conn_users(cola, colb)
update fact.conn_users
insert dim.code(cola, colb)


(?<=insert(\s+into\s+|\s+))((\[|)\w+(\]|)|(\[|)\w+(\]|)|)(\.|)(\[|)(?i)fact(\]|)\.(\w+|\[[^\]]*])

蟆郁骸
[dw].[fact].[conn_users]
[Fact].conn_users
Fact.conn_users
fact.conn_users
dw.fact.conn_users
[dw].fact.[conn_users]
[dw].fact.[Conn users]
fact.conn_users
fact.conn_users

5 ろる.企 #

select * 
from dw.fact.tablex a
	inner join  Dim.tabley b
		on a.id = b.id
	inner join [fact].tablec c
		on a.id = c.id
		
select * 
from dw.etl.tablex a
	inner join  realtime.tabley b
		on a.id = b.id
	inner join dbo.tablec c
		on a.id = c.id
	inner join bill.tablec d
		on a.id = d.id

(\w+\.|)(\[|)(?i)(fact|dim|etl|realtime|bill|dbo)(\]|)\.\w+

蟆郁骸
dw.fact.tablex
Dim.tabley
[fact].tablec
dw.etl.tablex
realtime.tabley
dbo.tablec
bill.tablec

るジ


insert into	 [dw].[fact].[conn_users]
insert into [Fact].conn_users
insert into Fact.conn_users
insert into fact.conn_users
insert into	 dw.fact.conn_users
insert into	 [dw].fact.[conn_users]
insert into	 [dw].fact.[conn users]
insert into
fact.conn_users
insert fact.conn_users(cola, colb)
update fact.conn_users
insert dim.code(cola, colb)


(\[\w+\]\.|\w+\.|)(\[|)(?i)(temp|fact|dim|etl|realtime|bill|dbo)(\]|)\.(\w+|\[[^\]]*])

蟆郁骸
dw.fact.aaaa
dw.[fact].aaaa
fact.aaaa
fact.[aaaa]
Fact.AAAA
[fact].[aaaa bbb]
dw.[fact].[aaaa bbb]
[dw].[fact].[aaaa bbb]

6 轟 覓語企 觸願鍵 #

abc2
abc
 abc
first_abc
abc_level

(\s|)\babc\b

蟆郁骸
abc
 abc

7 html 蠏碁 觸願鍵 #

<a href="http://www.aaa.com">aaa.com</a><br><br>

<[^>]*>

8 一危 覓語 蟲覿 csv #

a,"bcd, efg",h,i

(?=(?:[^"]|"[^"]*")*$)

螳 蟲覿(split)
  • a
  • "bcd, efg"
  • h
  • i

9 覦一(array) #

expression
\[\d*(?:,\s*\d+)*\]

text
Name=伎, Skill=[1, 2,3]

蟆郁骸
[1, 2,3]


10 覃覓語 #

$()*+.?[\^{|

escape 覓語
text <- "abcd $efg hig"
pattern <- "\\$efg"
unlist(regmatches(text, regexec(pattern, text)))

> unlist(regmatches(text, regexec(pattern, text)))
[1] "$efg"

譬襭蟯(]), 危(-), 譬襭譴蟯(}) 覃 覓語 觜語. 譬襭蟯(]), 危(-) 伎れ危 豌襴讌 蟯([) れ 蟆曙一襷 覃 覓語襦 語覃, 譬襭譴蟯(}) 伎れ 豌襴讌 譴蟯({) れ 蟆曙一襷 覃覓語襦 語. 譬襭 蟯 ),},] 伎れ危 豌襴 殊 覃覓語襦 覿襯讌 .

11 蠍磯蓋 襷れ広 #

覓語伎 轟 願 讌
text <- "abcd efg hig"
pattern <- "efg"
unlist(regmatches(text, regexec(pattern, text)))

> unlist(regmatches(text, regexec(pattern, text)))
[1] "efg"

蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2021-04-20 15:15:56

伎觜螳 企Μ螻 . 轟 覦 螳 一一 ク. 蠏瑚朱 豢覿.蟲讌蟲讌蟆 觜螳 る蟲! 企 襷 覓伎 螳. 觜 蟲襴 覦 蟆一 襷襦 讌 伎Ц 觜 覯 る所 企Μ蟲謂螻 襷讌 覈詩螳. <<襷 覲牛伎 255螳讌 伎手鍵>> ()