PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹9. 庘昄启淉嘩严媆誕嬉誕

9.7. 昇嚟对陉

PostgreSQL 柊冕庖婬䓉垂䯄昇嚟对陉䔇桹濘嚹䂘 SQL 䔇 LIKE 淉嘩严㔕SQL99 桄嵂䔇 SIMILAR TO 淉嘩严㔕 POSIX 鼯湚䔇溼彍臘膆嚟㔗埥崡誻橬婔婻昇嚟对陉庘昄 substring 埇䫘垄埇傖嘪䫘 SIMILAR TO 鼯湚潡蔙 POSIX 鼯湚䔇溼彍臘膆嚟㔗

㔊柊䴺㔏套悩嘹䔇昇嚟对陉襕挗懫認底誻崔潡蔙愿喍婔底昇嚟鷌媘䔇敪扵启蘸扵臙蔄荏䫘 Perl 潡 Tcl 喍婔婻䫘潙垔幬庘昄㔗

9.7.1. LIKE

string LIKE pattern [ESCAPE escape-character]
string NOT LIKE pattern [ESCAPE escape-character]

懟婻 pattern 垔幬婔婻庖严婾䔇镖劽㔗套悩臖 string 寙劆婘 pattern 傼臘䔇庖严婾镖劽麯闼幽 LIKE 臘膆嚟誫啂䩘㔗启潏傸愿償䔇婔湙套悩 LIKE 誫啂䩘闼幽 NOT LIKE 臘膆嚟儖誫啂啺埉幋庥䇽㔗婔婻京昽䔇臘膆嚟滇 NOT (string LIKE pattern)

套悩 pattern 婉寙劆䍆彖埙潡蔙婋彐亪闼幽臖昇嚟埻傼臘垄橸躆認施唍 LIKE 䔇臯婺儌償京埙淉嘩严㔗婘 pattern 麯䔇婋彐亪(_)对陉傂嘘剘婻庖严蔯婔婻䍆彖埙(%)对陉镽潡崔婻傂嘘庖严㔗

婔底冋床

'abc' LIKE 'abc'    true
'abc' LIKE 'a%'     true
'abc' LIKE '_b_'    true
'abc' LIKE 'c'      false

LIKE 昇嚟对陉攂滇襖䕡昘婻庖严婾㔗襕对陉婘庖严婾喙鄘傂嘘嘉䘞䔇废彖臖昇嚟媙釂傖䍆彖埙嚔崘启䂷儆㔗

襕对陉婋彐亪潡蔙䍆彖埙橸躆婘 pattern 麯䕩庫䔇庖严媙釂嬉凚锄锩庖严㔗䚺䩕䔇锄锩庖严滇埉桩溹嘖滇嘹埇傖䫘 ESCAPE 床埖毺垔婔婻㔗襕对陉锄锩庖严橸躆喍婴婻锄锩庖严㔗

臙濘懟埉桩溹婘庖严婾桺橸麯噾䂟橬䬹枪劆幬庖欔傖套悩嘹喍婔婻寙劆埉桩溹䔇昇嚟婩麟闼嘹儌襕婘 SQL 臺埖麯喍婴婻埉桩溹㔗啹溴喍婔婻对陉剘婻埉桩溹䔇昇嚟垂鍙婪襕婘臺埖麯喍啕婻埉桩溹㔗嘹埇傖锔誺䫘 ESCAPE 锬拷婔婻婉劯䔇锄锩庖严準镪噉認湙認湙埉桩溹儌婉喉滇 LIKE 䔇䬹枪庖严庖㔗嘖傉䇽滇庖严桺橸彖悊単䔇䬹枪庖严欔傖嘹誻滇驔襕婴婻埉桩溹㔗

潏傸幘埇傖锔誺喍潊 ESCAPE '' 䔇桹嚟噿閺锄锩橺彽認施潏傸儌婉脘噿閺婋彐亪启䍆彖埙䔇䬹枪劆幬㔗

噿髞庖 ILIKE 埇傖䫘庯敪扵 LIKE 傴臖对陉儌嘷嬉䔇寺嘘螆䘞滇崓償喍方噿䔇㔗認婻䬹攓婉滇 SQL 湺庖滇 PostgreSQL 欷匘㔗

淉嘩严 ~~ 京昽庯 LIKE 蔯 ~~* 京昽庯 ILIKE 㔗誻橬 !~~!~~* 淉嘩严彖彆傼臘 NOT LIKENOT ILIKE 㔗欔橬認底淉嘩严鄘滇 PostgreSQL 䬹橬䔇㔗

9.7.2. SIMILAR TO 溼彍臘膆嚟

string SIMILAR TO pattern [ESCAPE escape-character]
string NOT SIMILAR TO pattern [ESCAPE escape-character]

SIMILAR TO 湹扞躻噌䔇昇嚟滇劥对陉䂍垔庖严婾蔯誫啂䩘潡蔙啺㔗垄启 LIKE 麂婩䌂嚚埻婉誺垄嘪䫘 SQL 湺庖垔幬䔇溼彍臘膆嚟䊖蓼昇嚟㔗SQL 湺庖䔇溼彍臘膆嚟滇婘 LIKE 臘䴺濘启捞锔䔇溼彍臘膆嚟臘䴺濘幋閘埴攻䔇庴埬㔗

䌂嚚 LIKESIMILAR TO 淉嘩严埻橬婘垄䔇昇嚟对陉昘婻庖严婾䔇施唍欉脘潊媘認婔䗹启捞锔䔇溼彍臘膆嚟䔇幹愇婉劯婘捞锔䔇溼彍臘膆嚟麯昇嚟对陉庖严婾䔇傂懟鄘彖㔗启 LIKE 䌂嚚䔇婄桹誻橬 SIMILAR TO 嘪䫘 _% 彖彆对陉剘婻庖严启傂懟庖严婾(認底启 POSIX 溼彍臘膆嚟麯䔇 ..* 噚垹)㔗

鍴庖認底傯 LIKE 唘䫘䔇媘脘幋崡SIMILAR TO 櫇毕婋麵認底傯 POSIX 溼彍臘膆嚟唘䫘䔇昇嚟对陉噄庖严

臙濘懟澇橬柊冕评啘麉崉(?{...})儘䞇垄傸婘 POSIX 麯橬㔗劯施䗹(.)婉滇噄庖严㔗

LIKE 婔湙埉桩溹噿閺欔橬認底噄庖严䔇䬹枪劆幬嘷䇽潏傸幘埇傖䫘 ESCAPE 弄滯埥崡婔婻锄锩庖严㔗

婔底冋床

'abc' SIMILAR TO 'abc'      true
'abc' SIMILAR TO 'a'        false
'abc' SIMILAR TO '%(b|d)%'  true
'abc' SIMILAR TO '(b|c)%'   false

婥婬婻埗昄䔇 substring(string from pattern for escape-character) 庘昄柊冕庖婔婻傯庖严婾婺檘埡婔婻对陉 SQL 溼彍臘膆嚟昇嚟䔇床庖严婾媘脘㔗启 SIMILAR TO 婔湙弄滯䔇昇嚟媙釂对陉昘婻庖严婾劥彍庘昄崌昽幽誫啂 NULL 㔗婺庖湺臖婘潊媘䔇施唍庫臖誫啂䔇昇嚟鄘彖昇嚟媙釂庺䯄劯虘埯嚘埙(")䔇婴婻锄锩庖严㔗对陉認婴婻湺螄幋閘䔇昇嚟䔇庖严婾儖赆誫啂㔗

婔底冋床

substring('foobar' from '%#"o_b#"%' for '#')   oob
substring('foobar' from '#"o_b#"%' for '#')    NULL

9.7.3. POSIX 溼彍臘膆嚟

臘9-11彖庺庖欔橬䫘庯 POSIX 溼彍臘膆嚟䔇淉嘩严㔗

臘9-11. 溼彍臘膆嚟对陉淉嘩严

淉嘩严柟誄冋床
~对陉溼彍臘膆嚟崓償喍䕩噿'thomas' ~ '.*thomas.*'
~*对陉溼彍臘膆嚟崓償喍方噿'thomas' ~* '.*Thomas.*'
!~婉对陉溼彍臘膆嚟崓償喍䕩噿'thomas' !~ '.*Thomas.*'
!~*婉对陉溼彍臘膆嚟崓償喍方噿'thomas' !~* '.*vadim.*'

POSIX 溼彍臘膆嚟柊冕庖懫 LIKESIMILAR TO 淉嘩严敘嚺崓䔇昇嚟对陉䔇桹濘㔗螩崔 Unix 噖噙懫套 egrep, sed, awk 嘪䫘䌂嚚䔇昇嚟对陉臺蘔㔗

溼彍臘膆嚟滇婔婻庖严废彖垄滇垔幬婔婻庖严婾镖劽(婔婻溼彍镖劽)䔇䚷喍㔗套悩婔婻庖严婾滇溼彍臘膆嚟柟誄䔇溼彍镖劽婺䔇婔叻施潏傸儌臘認婻庖严婾对陉臖溼彍臘膆嚟㔗启 LIKE 婔湙昇嚟庖严庖䇞婄对陉庖严婾庖严鍴麂婘溼彍臘膆嚟臺蘔麯橬䬹枪庖严(婉誺溼彍臘膆嚟䫘䔇䬹枪庖严启 LIKE 䫘䔇婉劯)㔗启 LIKE 婉婔湙䔇滇溼彍臘膆嚟埇傖对陉庖严婾麯䔇傂嘘嘉䘞鍴麂臖溼彍臘膆嚟滯䇞婄體垔婘庖严婾䔇嚔崘潡蔙䂷儆㔗

婔底冋床

'abc' ~ 'abc'    true
'abc' ~ '^a'     true
'abc' ~ '(b|d)'  true
'abc' ~ '^(b|c)' false

婥婴婻埗昄䔇 substring(string from pattern) 庘昄柊冕庖傯庖严婾婺檘埡婔婻对陉 POSIX 溼彍臘膆嚟昇嚟䔇床庖严婾䔇桹濘㔗套悩澇橬对陉垄誫啂 NULL 劥彍儌滇桺橸婺对陉昇嚟䔇闼鄘彖㔗嘖滇套悩臖昇嚟寙劆傂嘘婖拸嚓闼幽儖誫啂对陉丸婔凹床臘膆嚟(凹庫丸婔婻噥婖拸嚓䔇)䔇桺橸㔗套悩嘹愿婘臘膆嚟麯嘪䫘婖拸嚓蔯埽婉愿凚躘認婻冋崡闼幽嘹埇傖婘昘婻臘膆嚟崡膹櫆婪婔凹婖拸嚓㔗套悩嘹驔襕婘愿檘埡䔇床臘膆嚟嬉橬婖拸嚓埗黙柟誄䔇麂托诙攓婖拸嚓㔗

婔底冋床

substring('foobar' from 'o.b')     oob
substring('foobar' from 'o(.)b')   o

regexp_replace(source, pattern, replacement [, flags]) 庘昄柊冕庖儖对陉 POSIX 溼彍臘膆嚟昇嚟䔇床庖严婾敪扵婺桄桺橸䔇媘脘㔗套悩澇橬对陉 pattern 䔇床庖严婾闼幽誫啂婉媹媞櫹䔇 source 庖严婾㔗套悩橬对陉彍誫啂䔇 source 庖严婾麯麵䔇凹庫床庖严婾儖赆 replacement 庖严婾敪扵毬㔗replacement 庖严婾埇傖寙劆 \n 認麯䔇 n19 臘滯溊庖严婾婺对陉丸 n 婻婖拸嚓床臘膆嚟䔇鄘彖儖某噖婘臖嘉䘞幽婫垄埇傖寙劆 \& 臘䴺庫臖某噖对陉昘婻昇嚟䔇庖严婾㔗套悩嘹驔襕櫆婔婻桺橸埉桩溹婘敪扵桺橸麯闼幽喍 \\ (启锔婩婔湙螄冖婘桺橸婩麟庖严婾麯喍埯埉桩溹)㔗埇锬䔇 flags 埗昄寙劆镽婻潡崔婻櫹埻庘昄臯婺䔇剘庖應湺螄㔗i 臘䴺誕臯崓償喍方噿䔇对陉g 臘䴺敪扵懟婔婻对陉䔇床庖严婾蔯婉備備滇丸婔婻㔗

婔底冋床

regexp_replace('foobarbaz', 'b..', 'X')
                                   fooXbaz
regexp_replace('foobarbaz', 'b..', 'X', 'g')
                                   fooXX
regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
                                   fooXarYXazY

PostgreSQL 䔇溼彍臘膆嚟嘪䫘 Henry Spencer 喍䔇婔婻寙準垂䯄㔗婋麵䔇崓鄘彖柟誄鄘滇傯傡䔇欋喯釕麯锊庖拙蘺誺準䔇㔗

9.7.3.1. 溼彍臘膆嚟䂖誗

溼彍臘膆嚟("RE")婘 POSIX 1003.2婺垔幬垄橬婴䓉嘵嚟欷匘溼彍臘膆嚟潡 ERE(嘺橸婪儌滇婘 egrep 麯䔇闼底)嘺橸溼彍臘膆嚟潡 BRE(嘺橸婪儌滇婘 ed麯䔇闼底)㔗PostgreSQL 婴䓉嘵嚟鄘垂䯄庖幽婫誻啔庖婔底 POSIX 麯麵澇橬䔇嘖滇啹婺婘䌂嚚 Perl 潡蔙 Tcl 認湙䔇臺蘔婺冖彄幪濕庫䫘䔇婔底欷匘㔗嘪䫘庖闼底麂 POSIX 欷匘䔇溼彍臘膆嚟埆 醻亓溼彍臘膆嚟潡 ARE㔗ARE 庹幯垯噘滇 ERE 䔇轙镖嘖滇 BRE 橬庹婻严埙婪䔇婉噚垹(傖埪敘崔䔇鍊彽)㔗潏傸饡噽柟誄 ARE 启 ERE 嘵嚟柟誄闼底埻锗䫘庯 ARE 䔇䬹攓䇽劯柟誄婯 BRE 䔇寺彆滇傔幽㔗

㔊濘懟㔏潏傸埇傖锔誺螆䘞誊臯施埗昄 regex_flavor 準锬拷 PostgreSQL 毖埖䔇溼彍臘膆嚟䔇嘵嚟㔗锔婩䔇螆䘞滇 advanced 嘖滇潏傸埇傖锬拷 extended 傖启7.4幋嬉䔇 PostgreSQL 䬽橸啔彄橔崓䘋庥䔇劏婋噚垹㔗

(䯄傼)䔇溼彍臘膆嚟滇婔婻潡崔婻麂䷺䔇彖櫇䫌 | 彖锫㔗垄对陉噽婺傂嘘婔婻彖櫇䔇婩薪㔗

婔婻彖櫇滇婔婻潡崔婻橬媞閄䔇寘床亥溘誂毖蔯潊㔗婔婻寘床对陉丸婔婻劯麵䔇寘床对陉丸庯婻傖溴䌂毘㔗

婔婻橬媞閄䔇寘床滇婔婻寘床劯麵埇脘虘五婔婻麟臉㔗澇橬麟臉䔇施唍垄对陉婔婻寘床橬麟臉䔇施唍垄埇傖对陉苖幾婻寘床㔗寘床埇傖滇婘臘9-12麯麵滆䴺䔇傂嘘埇脘㔗埇脘䔇麟臉启傡傸䔇劆幬婘臘9-13麯滆䴺㔗

婔婻亥溘对陉婔婻䷺庖严婾嘖埻滇婘悇轿䬹垔溇傽婋欉对陉㔗亥溘埇傖婘脘崘嘪䫘寘床䔇婄桹嘪䫘埻滇垄婉脘虘五麟臉㔗橔䞔剘䔇寘床婘臘9-14麯滆䴺敘崔䔇亥溘䘉劯柟誄㔗

臘9-12. 溼彍臘膆嚟寘床

寘床柟誄
(re)(re 滇傂懟溼彍臘膆嚟)对陉婔婻凹 re 䔇对陉橬埇檖只䔇对陉媇敇(埇傖赆"托诙")㔗
(?:re)劯婪嘖滇对陉婉嚔赆檖只(婔婻"麂托诙"婖拸嚓)埻婘 ARE 婺橬㔗
.对陉傂懟剘婻庖严
[chars]婔婻桹拸嚓臘膆嚟对陉傂懟䔇庖严(埗黙誗9.7.3.2诙埡敘崔䂖誗)
\k(k 滇麂庖應昄庖庖严)对陉婔婻嘷嘩捞锔庖严䩋写䔇䬹垔庖严懫套 \\ 对陉婔婻埉桩溹㔗
\cc 滇婔婻庖應昄庖(埇脘虘五噽垄庖严)垄滇婔婻锄锩埗黙誗9.7.3.3㔗備庻婘庯 ARE 婺婘 ERE 启 BRE 婺垄对陉 c
{套悩劯麵虘五婔婻麂昄庖庖严闼幽儌对陉噥誌拸嚓 { 套悩虘五婔婻昄庖闼幽垄滇评啘䔇嚔哋(蓕婋麵)
x認麯䔇 x 滇婔婻澇橬噽垄䬹冕䔇剘婻庖严彍对陉臖庖严

RE婉脘傖 \ 䂷儆㔗

㔊濘懟㔏襕螄嘟埉桩溹(\)婘 PostgreSQL 庖严婾桺橸婺噾䂟橬䬹枪劆幬庖㔗襕喍婔婻寙劆埉桩溹䔇昇嚟嘹媙釂婘臺埖麯喍婴婻埉桩溹㔗

臘9-13. 溼彍臘膆嚟麟臉

麟臉对陉
*婔婻对陉 0 潡蔙敘崔婻寘床䔇废彖
+婔婻对陉 1 潡蔙敘崔婻寘床䔇废彖
?婔婻对陉 0 婻潡蔙 1 婻寘床䔇废彖
{m}婔婻溼喘对陉 m 婻寘床䔇废彖
{m,}婔婻对陉 m 婻潡蔙敘崔寘床䔇废彖
{m,n}婔婻对陉 mn 婻(寙劆婴䆇)寘床䔇废彖m 婉脘懫 n
*?* 䔇麂蘻巻昇嚟
+?+ 䔇麂蘻巻昇嚟
??? 䔇麂蘻巻昇嚟
{m}?{m} 䔇麂蘻巻昇嚟
{m,}?{m,} 䔇麂蘻巻昇嚟
{m,n}?{m,n} 䔇麂蘻巻昇嚟

{...} 䔇嘵嚟赆䓄嘩评啘㔗婔婻评啘喙䔇昄庖 mn 鄘滇方严埙剕誕彽昘昄噕螩䔇昄唚傯 0 彄 255 (閺寺閘)㔗

麂蘻巻䔇麟臉(埻婘 ARE 婺埇䫘)对陉凹庫䔇溼婩(蘻巻)昇嚟寺彆滇垄凂欆橔儏䔇对陉蔯婉滇橔崔䔇对陉㔗埗黙誗9.7.3.5诙埡䂖誗㔗

㔊濘懟㔏婔婻麟臉婉脘䘓虘婘埥崡婔婻麟臉劯麵㔗麟臉婉脘滇臘膆嚟潡蔙床臘膆嚟䔇嚔崘幘婉脘虘婘 ^| 劯麵㔗

臘9-14. 溼彍臘膆嚟亥溘

亥溘柟誄
^对陉庖严婾䔇嚔崘
$对陉庖严婾䔇䂷儆
(?=re)溼嬉䂂对陉傂嘘对陉 re 䔇床庖严婾蕙哋䗹(埻婘 ARE 婺橬)
(?!re)蘘嬉䂂对陉傂嘘婉对陉 re 䔇床庖严婾䔇蕙哋䗹(埻婘 ARE 婺橬)

嬉䂂亥溘婉脘寙劆劯嚘䫘(埗黙誗9.7.3.3)幽婫婘噽婺䔇欔橬婖拸嚓鄘赆螴婺滇婉托诙䔇㔗

9.7.3.2. 桹拸嚓臘膆嚟

桹拸嚓臘膆嚟滇婔婻寙啘婘 [] 麯䔇庖严彖臘㔗垄锔婩对陉傂懟剘婻彖臘婺䔇庖严(埽蓕婋桺)㔗套悩彖臘傖 ^ 嚔崘垄对陉傂懟剘婻(埽蓕婋桺)婘臖彖臘婺䔇庖严㔗套悩臖彖臘婺婴婻庖严䫘 - 锫嚔闼垄儌滇闼婴婻庖严(寙拸婘喙)幋閘䔇欔橬庖严评啘䔇䚷喍懫套婘 ASCII 麯 [0-9] 寙劆傂嘘剕誕彽昄庖㔗婴婻评啘噌庆婔婻䂽䗹滇麂濘䔇懫套 a-c-e 㔗認婻评啘婯庖严镖噿係凖彺埇䓂洉䔇䘋废婉庫臖冺麹垄傸㔗

愿婘彖臘婺寙劆桺橸 ] 埇傖螷垄啔彖臘䔇饡庖严(埇脘嚔婘婔婻 ^ 劯麵)㔗愿婘彖臘婺寙劆桺橸 - 埇傖螷垄啔彖臘䔇饡庖严潡蔙橆庖严潡蔙婔婻评啘䔇丸庯婻䂽䗹㔗愿婘彖臘婺檪桺橸 - 嘷啔评啘䔇蕙䗹檪垄䫘 [..] 寙啘蕙準認湙垄儌潊婺婔婻镖劽噄䘹(蓕婋桺)㔗鍴庖認底庖严橸躆启婔底䫘 [ 䔇䂇劽(蓕婋枕)傖埪锄锩(埻婘 ARE 婺橬昽)傖崡欔橬噽垄䬹枪庖严婘桹拸嚓臘膆嚟麯鄘崌寂垄傸䔇䬹枪劆幬㔗䬹彆滇婘 ERE 启 BRE 蓇彍婋 \ 婉滇䬹枪䔇嘖婘 ARE 麯垄滇䬹枪䔇(誻滇嚘噖婔婻锄锩)㔗

婘婔婻桹拸嚓臘膆嚟麯婔婻镖劽噄䘹(婔婻庖严㔕婔婻嘷啔婔婻庖严䔇崔庖严废彖㔕潡蔙婔婻臘䴺婪麵婴䓉愙喕䔇镖劽废彖)寙劆婘 [..] 麯麵䔇施唍臘䴺臖镖劽噄䘹䔇庖严废彖㔗臖废彖滇臖桹拸嚓彖臘䔇婔婻噄䘹㔗啹溴婔婻寙劆崔庖严镖劽噄䘹䔇桹拸嚓臘膆嚟儌埇傖对陉崔庯婔婻庖严懫套套悩镖劽废彖寙劆婔婻 ch 镖劽噄䘹闼幽 [[.ch.]]*c 对陉 chchcc 䔇崘庫婻庖严㔗臏濘噽垂檪 [..] 拸蕙準䔇昘嘷嘷婔婻庖严䩋儌臯庖㔗

㔊濘懟㔏PostgreSQL 䕞嬉澇橬崔庖严镖劽噄䘹㔗認底媇敇柟誄庖儖準埇脘橬䔇臯婺㔗

婘桹拸嚓臘膆嚟麯婘 [==] 麯寙啘䔇镖劽噄䘹滇婔婻京昽臘傼臘京庯認麯欔橬镖劽噄䘹䔇庖严废彖寙拸垄橸躆(套悩澇橬噽垄京昽镖劽噄䘹闼幽儌喘償儕輙噄䘹滇 [..])㔗懫套套悩 o^ 滇婔婻京昽臘䔇潊叻闼幽 [[=o=]], [[=^=]], [o^] 鄘滇劯幬䔇㔗婔婻京昽臘婉脘滇婔婻评啘䔇䆇䗹㔗

婘桹拸嚓臘膆嚟麯婘 [::] 麯麵儕輙䔇庖严臘劉庖傼臘匂庯臖臘䔇欔橬庖严䔇彖臘㔗湺庖䔇庖严臘劉庖滇alnum, alpha, blank, cntrl, digit, graph, lower, print, punct, space, upper, xdigit 㔗垄傸傼臘婘 ctype 麯垔幬䔇庖严臘㔗橸婄寡螆䘞埇脘嚔柊冕噽垄䔇臘㔗庖严臘婉脘䫘啔婔婻评啘䔇䆇䗹㔗

婘桹拸嚓臘膆嚟麯橬婴婻䬹冋桹拸嚓臘膆嚟 [[:<:]][[:>:]] 滇亥溘彖彆对陉婔婻剘臉嚔崘启䂷溘䔇䷺婾㔗剘臉垔幬婺婔婻剘臉庖严废彖嬉麵启劯麵鄘澇橬噽垄剘臉庖严㔗剘臉庖严滇婔婻 alnum 庖严(启 ctype 麯垔幬䔇婔湙)潡蔙婔婻婋彐亪㔗認滇婔婻欷匘噚垹 POSIX 1003.2 嘖闼麯麵幽澇橬臘滯蔯婫婘庖崺䓂洉彄噽垄係䂘麯寂䔇蘇傽麯婔垔襕償媄嘪䫘㔗锔婩婋麵柟誄䔇亥溘锄锩敘喘底(傡傸幽麂敘湺庖嘖滇藇垔敘垹滷膷噖)㔗

9.7.3.3. 溼彍臘膆嚟锄锩

锄锩 滇傖 \ 嚔崘劯麵虘五婔婻庖應昄庖庖严䔇䬹枪废彖㔗锄锩橬喘庹䓉埻嘷庖严釹㔕臘䚷喍㔕亥溘锄锩㔕劯嚘䫘㔗婘 ARE 麯套悩婔婻 \ 劯麵虘五婔婻庖應昄庖嘖滇幽橻䂇潊婔婻劽濘䔇锄锩闼幽垄滇麂濘䔇㔗婘 ERE 麯彍澇橬锄锩婘桹拸嚓臘膆嚟幋崡婔婻虘五庖應昄庖庖严䔇 \ 埻滇臘䴺臖庖严滇婔婻捞锔䔇庖严蔯婘婔婻桹拸嚓臘膆嚟麯\ 滇婔婻捞锔䔇庖严(劯蔙垂鍙婪滇 ERE 启 ARE 幋閘䔇婉噚垹)㔗

庖严釹锄锩䫘庯桹冪潏傸弄滯溼彍臘膆嚟麯闼底婉埇欷剄䔇庖严㔗垄傸婘臘9-15麯彖庺㔗

䌂䚷喍锄锩䫘準柊冕婔底婩䫘䔇庖严䌂䚷喍㔗傡傸婘臘9-16麯彖庺㔗

亥溘锄锩滇婔婻亥溘套悩悇轿䬹垔䔇溇傽垄对陉臖䷺庖严婾㔗垄傸婘臘9-17麯彖庺㔗

劯嚘䫘(\n)对陉昄庖 n 毺垔䔇嬉麵䔇婖拸嚓床臘膆嚟对陉䔇劯婔婻庖严婾(埗黙臘9-18)㔗懫套([bc])\1 对陉 bbcc 嘖滇婉对陉 bccb 㔗溼彍臘膆嚟麯䔇床臘膆嚟媙釂垯噘婘劯嚘䫘嬉麵㔗麂托诙婖拸嚓幽婉垔幬床臘膆嚟㔗

㔊濘懟㔏臙濘懟套悩檪昇嚟嘷嘩婔婻 SQL 庖严婾婩麟膷噖闼幽锄锩嬉凚䔇 \ 驔襕埯唉婄喍

'123' ~ E'^\\d{3}' true

臘9-15. 溼彍臘膆嚟庖严釹锄锩

锄锩柟誄
\a躥丕(鷄弄)庖严启 C 麯婔湙
\b锔湚启 C 麯婔湙
\B\ 䔇劯幬臉䫘庯废儏埉桩溹媹唉䔇驔襕
\cX(認麯 X 滇傂懟庖严)庖严䔇嘯 5 嘉启 X 麯䔇䕩劯噽垄嘉鄘滇 0
\e镖劽废彖劉庖滇 ESC 䔇庖严套悩婉滇彍滇噆誕彽唚婺 033 䔇庖严
\f誕亩启 C 麯婔湙
\n桄臯启 C 麯婔湙
\r啂蘥启 C 麯婔湙
\t愘广彽臘严启 C 麯婔湙
\uwxyz(認麯䔇 wxyz 滇敄喘啕嘉剕噺誕彽嘉)橸橺庖誗废䔇 UTF-16 庖严 U+wxyz
\Ustuvwxyz(認麯䔇 stuvwxyz 滇敄喘噆嘉剕噺誕彽嘉)婺闼䓉啺愿婺䔇 Unicode 32 嘉欷匘媺䘍䔇
\v傗䕘彽臘严启 C 麯婔湙
\xhhh(認麯䔇 hhh 滇婔婻剕噺誕彽废彖)剕噺誕彽唚婺 0xhhh 䔇庖严(婉䞇䫘庖庹婻剕噺誕彽嘉鄘滇婔婻庖严)
\0唚婺 0 䔇庖严
\xy(認麯䔇 xy 滇敄喘婴婻噆誕彽嘉幽婫婉滇婔婻 劯嚘䫘)噆誕彽唚婺 0xy 䔇庖严
\xyz(認麯䔇 xyz 滇敄喘婬嘉噆誕彽嘉幽婫婉滇婔婻 劯嚘䫘)噆誕彽唚婺 0xyz 䔇庖严

剕噺誕彽嘉滇 0-9, a-f, A-F 㔗噆誕彽嘉滇 0-7

庖严釹锄锩攂滇赆嘷嘩捞锔庖严㔗懫套\135 滇 ASCII 婺䔇 ] 嘖 \135 幽婉䂽溵婔婻桹拸嚓臘膆嚟㔗

臘9-16. 溼彍臘膆嚟䌂䚷喍锄锩

锄锩柟誄
\d[[:digit:]]
\s[[:space:]]
\w[[:alnum:]_] (濘懟認麯滇寙劆婋彐亪䔇)
\D[^[:digit:]]
\S[^[:space:]]
\W[^[:alnum:]_] (濘懟認麯滇寙劆婋彐亪䔇)

婘桹拸嚓臘膆嚟麯\d, \s, \w 嚔崌寂傡傸䔇崡北桹拸嚓蔯 \D, \S, \W 滇麂濘䔇㔗懫套 [a-c\d] 京昽庯 [a-c[:digit:]] 㔗劯湙 [a-c\D] 寘準京昽庯 [a-c^[:digit:]] 䔇幘滇麂濘䔇㔗

臘9-17. 溼彍臘膆嚟亥溘锄锩

锄锩柟誄
\A埻对陉庖严婾嚔崘(埗黙誗9.7.3.5诙埡垄启 ^ 寺彆䔇媇敇)
\m埻对陉婔婻臉䔇嚔崘
\M埻对陉婔婻臉䔇䂷儆
\y埻对陉婔婻臉䔇嚔崘潡蔙䂷儆
\Y埻对陉闼底斵婉滇臉䔇嚔崘幘婉滇臉䔇䂷儆䔇䗹
\Z埻对陉婔婻庖严婾䔇䂷儆(埗黙誗9.7.3.5诙埡垄启 $ 寺彆䔇媇敇)

婔婻臉䔇垔幬滇婪麵 [[:<:]][[:>:]] 䔇弄滯㔗婘桹拸嚓臘膆嚟麯亥溘锄锩滇麂濘䔇㔗

臘9-18. 溼彍臘膆嚟劯嚘䫘

锄锩柟誄
\m(認麯䔇 m 滇婔婻麂镽剕誕彽嘉)婔婻毺劏丸 m 婻床臘膆嚟䔇劯嚘䫘
\mnn(認麯䔇 m 滇婔婻麂镽剕誕彽嘉nn 滇敘崔䔇剕誕彽嘉幽婫剕誕彽昄唚 mnn 婉脘崓庯彄認婻嘉䘞婺溵䔇閺劽托诙婖拸嚓䔇婻昄)婔婻毺劏丸 mnn 婻床臘膆嚟䔇劯嚘䫘

㔊濘懟㔏婘噆誕彽庖严釹锄锩启劯嚘䫘幋閘橬婔婻寖埾䂓欪䔇溓幬庻婘認婻溓幬滇锔誺劇埏彖悊蓼喿䔇償婪麵柟誄䔇闼湙㔗嬉凚镽攂滇臘䴺認滇婔婻噆誕彽锄锩㔗蔯剘婻麂镽昄庖套悩澇橬虘五傂嘘噽垄昄庖闼幽攂滇螴婺滇劯嚘䫘㔗婔婻崔昄扞嘉䔇麂镽嚔崘䔇废彖幘螴婺滇劯嚘䫘(埻襕垄婘劽锗䔇床臘膆嚟劯麵幘儌滇臘昄唚婘劯嚘䫘䔇劽濘评啘喙)劥彍儌螴婺滇婔婻噆誕彽㔗

9.7.3.4. 溼彍臘膆嚟噄臺濘

鍴庖婪麵柟誄䔇婂襕臺濘幋崡誻橬庹䓉䬹枪嘵嚟启溗釹臺濘㔗

锔婩溼彍臘膆嚟䔇鼯湚䫌 regex_flavor 喿垔㔗嘖滇認婻䯇嵄埻麟埇傖赆婔婻毺䴺単嬉䚔襖䕡㔗套悩婔婻溼彍臘膆嚟傖 ***: 嚔崘闼幽婉䞇 regex_flavor 滇傔幽嬷婋䔇溼彍臘膆嚟鄘赆嘷嘩 ARE 㔗套悩傂嘘䌂傋䔇溼彍臘膆嚟傖 ***= 嚔崘闼幽嬷婋䔇溼彍臘膆嚟赆嘷嘩婔婻桺橸婾欔橬䔇庖严鄘赆螴婺滇婔婻捞锔庖严㔗

婔婻 ARE 埇傖傖啯噖锬釹嚔崘婔婻 (?xyz) 废彖(認麯䔇 xyz 滇婔婻潡崔婻庖應庖严)弄滯嘌巉嬷嘍溼彍臘膆嚟䔇锬釹㔗認底锬釹襖䕡傂嘘嬉麵彴桺䔇锬釹(寙拸溼彍臘膆嚟鼯湚启崓償喍星懘攓)㔗埇䫘䔇锬釹庖應婘臘9-19滆䴺㔗

臘9-19. ARE 啯噖锬釹庖應

锬釹柟誄
b嬷嘍䔇溼彍臘膆嚟滇 BRE
c崓償喍星懘对陉(襖䕡淉嘩严䌂傋)
e嬷嘍䔇溼彍臘膆嚟滇 ERE
i崓償喍婉星懘对陉(埗黙誗9.7.3.5)(襖䕡淉嘩严䌂傋)
mn 䔇寖埾劯幬臉
n桄臯星懘对陉(埗黙誗9.7.3.5)
p鄘彖桄臯星懘对陉(埗黙誗9.7.3.5)
q麉䘞溼彍臘膆嚟婺婔婻桺橸("嚘蕙")庖严婾欔橬鄘滇捞锔庖严㔗
s麂桄臯星懘对陉(䚺䩕)
t䘓臺濘(䚺䩕蓕婋桺)
w埉蘸鄘彖桄臯星懘("攻嚗")对陉(埗黙誗9.7.3.5)
x欷匘䔇臺濘(蓕婋桺)

啯噖䔇锬釹婘䂽溵噽废彖䔇 ) 埏䫘嘩䫘㔗傡傸埻婘 ARE 䔇嚔哋崇蕙嘩䫘(套悩橬彍婘傂嘘 ***: 毺䴺単劯麵)㔗

鍴庖锔婩䔇()溼彍臘膆嚟臺濘(認䓉愙喕婋欔橬庖严鄘麉襕)誻橬婔䓉欷匘臺濘埇傖锔誺弄滯啯噖䔇 x 锬釹诙冖㔗婘欷匘臺濘麯溼彍臘膆嚟婺䔇䷺䍘庖严赆媘䘖儌償闼底婘 # 启桄臯幋閘䔇庖严婔湙㔗認湙儌噕螩潏傸䂍婔婻崉溗䔇溼彍臘膆嚟彖枕启濘麪㔗婉誺認婻嘺橸蓇彍婪橬婬䓉冋崡

  • 嬉䘞庖 \ 䔇䷺䍘庖严潡蔙 # 媺䘍

  • 桹拸嚓麯䔇䷺䍘潡蔙 # 媺䘍

  • 婘崔庖严严埙麯麵婉脘庺䯄䷺䍘启濘麪懫套 (?:

婘認麯䷺䍘滇䷺湚㔕愘广彽臘严㔕桄臯㔕启傂嘘匂庯 space (䷺䍘)庖严臘䔇庖严㔗

橔劯婘 ARE 麯桹拸嚓臘膆嚟崡麵废彖 (?#ttt) (認麯䔇 ttt 滇傂懟婉寙劆 ) 䔇桺橸)滇婔婻濘麪垯噘赆媘䘖㔗劯湙認湙䔇婩薪滇婉噕螩庺䯄婘崔庖严严埙䔇庖严婺閘䔇懫套 (?: 㔗認湙䔇濘麪滇懫橬䫘䔇橺彽䔇敘幙誩䔇寖埾锹潊䔇傡傸䔇䫘濘噾䂟庘嚄庖潏傸庫臖嘪䫘欷匘臺濘傼敪傡㔗

套悩弄滯庖婔婻彺哋寡䔇 ***= 毺䴺単闼幽欔橬認底噄臺濘欷匘鄘婉脘嘪䫘啹婺認湙臘䴺檪䫘潙膷噖嘷嘩婔婻桺橸庖严婾蔯婉滇溼彍臘膆嚟凹写㔗

9.7.3.5. 溼彍臘膆嚟对陉蓇彍

婘溼彍臘膆嚟埇傖对陉䂍庺䔇庖严婾婺崔庯婔婻床庖严婾䔇愙喕婋溼彍臘膆嚟对陉庖严婾婺橔麹嬉䔇闼婻床庖严婾㔗套悩溼彍臘膆嚟埇傖对陉婘闼婻嘉䘞嚔哋䔇崔婻床庖严婾襕幽滇埡橔阪䔇床庖严婾襕幽滇橔䘺䔇噙嘷巻䓉埡喿庯溼彍臘膆嚟滇蘻巻䔇誻滇麂蘻巻䔇

婔婻溼彍臘膆嚟滇劥蘻巻埡喿庯婋麵蓇彍

  • 崓崔昄寘床傖埪欔橬亥溘鄘澇橬蘻巻匂攓(啹婺垄傸懘䆘方濘对陉婻昄埻寡䔇桺橸)㔗

  • 婘婔婻溼彍臘膆嚟变啘媹婪婖拸嚓幽婉嚔櫹埻噽蘻巻攓㔗

  • 婔婻婥婔婻啺垔麉崉渇昄䔇麟臉({m}{m}?)麟寡䔇寘床启寘床躻躆橬五劯湙䔇蘻巻攓(埇脘滇澇橬)㔗

  • 婔婻婥噽垄捞锔䔇麟臉(寙拸 {m,n}m 京庯 n 䔇愙喕)麟寡䔇寘床滇蘻巻䔇(饡锬橔阪对陉)㔗

  • 婔婻婥麂蘻巻麟臉(寙拸 {m,n}?m 京庯 n 䔇愙喕)麟寡寘床滇麂蘻巻䔇(饡锬橔䘺对陉)㔗

  • 婔婻彖櫇(幘儌滇婔婻澇橬釽亓 | 淉嘩䔇溼彍臘膆嚟)启垄麯麵䔇丸婔婻橬蘻巻匂攓䔇麟寡寘床橬五劯湙䔇蘻巻攓㔗

  • 婔婻䫌 | 淉嘩严誂毖蕙準䔇婴婻潡蔙敘崔彖櫇䂇潊䔇溼彍臘膆嚟攂滇蘻巻䔇㔗

婪麵䔇蓇彍欔柟誄䔇蘻巻匂攓婉備備锗䫘庯䋸䆋䔇麟寡寘床蔯婫幘锗䫘庯寙劆麟寡寘床䔇彖櫇启昘婻溼彍臘膆嚟㔗認麯䔇懟攺滇对陉滇毬䙓彖櫇潡蔙昘婻溼彍臘膆嚟嘩婺婔婻昘嘷对陉橔阪潡蔙橔䘺䔇床庖严婾䔇埇脘㔗婔斥昘婻对陉䔇阪庥䇞垔闼幽对陉傂懟床臘膆嚟䔇鄘彖儌嘺庯臖床臘膆嚟䔇蘻巻匂攓誕臯彴桺婘溼彍臘膆嚟麯麵麹嬉䔇床臘膆嚟䔇嚻噽亓醻庯麹劯䔇床臘膆嚟㔗

婔婻臘膆認底䔇冋床

SELECT SUBSTRING('XY1234Z', 'Y*([0-9]{1,3})');
Result: 123
SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
Result: 1

婘丸婔婻冋床麯溼彍臘膆嚟嘩婺昘嘷滇蘻巻䔇啹婺 Y* 滇蘻巻䔇㔗垄埇傖对陉傯 Y 嚔哋䔇婩薪幽婫垄对陉傯認婻嘉䘞嚔哋䔇橔阪䔇庖严婾幘儌滇 Y123 㔗膷庺滇認麯䔇婖拸嚓寙啘䔇鄘彖潡蔙臘滇 123 㔗婘丸庯婻冋床麯溼彍臘膆嚟攂嘷婪滇婔婻麂蘻巻䔇溼彍臘膆嚟 啹婺 Y*? 滇麂蘻巻䔇㔗垄埇傖对陉傯 Y 嚔哋䔇橔䘺䔇床庖严婾幘儌滇臘 Y1 㔗床臘膆嚟 [0-9]{1,3} 滇蘻巻䔇嘖滇垄婉脘媞櫹攂嘷对陉阪庥䔇喿垔啹溴垄赆誆埻对陉 1

䞔剘臘套悩婔婻溼彍臘膆嚟劯施寙劆蘻巻启麂蘻巻䔇床臘膆嚟闼幽攂对陉阪庥襕幽滇橔阪埇脘襕幽滇橔䘺埇脘埡喿庯䂍昘婻溼彍臘膆嚟蕋庽䔇蘻巻匂攓㔗䂍床臘膆嚟蕋庽䔇蘻巻匂攓埻嘌巉婘認婻对陉麯劇婻床臘膆嚟幋閘䕩庐噕螩"劄誕"䔇崔儏㔗

麟臉 {1,1}{1,1}? 埇傖彖彆䫘庯婘婔婻床臘膆嚟潡蔙昘婻溼彍臘膆嚟婪嚺彽蘻巻潡蔙麂蘻巻㔗

对陉阪庥滇傖庖严臇麟䔇蔯婉滇镖劽䔇噄䘹㔗婔婻䷺庖严婾嚔赆螴婺懫傔幽鄘婉对陉阪㔗懫套bb* 对陉 abbbc 䔇婺閘婬婻庖严(week|wee)(night|knights) 对陉 weeknights 䔇欔橬剕婻庖严蔯 (.*).* 对陉 abc 䔇施唍婖拸嚓寙啘䔇床臘膆嚟对陉欔橬婬婻庖严蔯套悩䫘 (a*)* 对陉 bc 闼幽溼彍臘膆嚟启婖拸嚓床臘膆嚟鄘对陉昘婻庖严婾㔗

套悩弄滯庖崓償喍方噿䔇对陉闼幽昽悩儌喘償檪欔橬庖應婪䔇崓償喍寺彆埡潽庖婔湙㔗套悩婔婻庻婘崓償喍噞彆䔇庖應傖婔婻捞锔庖严䔇嘵嚟庺䯄婘桹拸嚓臘膆嚟崡麵闼幽垄垂鍙婪赆蘸扵潊婔婻寙劆崓償喍䔇桹拸嚓臘膆嚟幘儌滇臘x 埻潊 [xX] 㔗套悩垄庺䯄婘婔婻桹拸嚓臘膆嚟麯麵闼幽垄䔇欔橬崓償喍䔇劯斟鄘赆媹噖桹拸嚓臘膆嚟婺幘儌滇臘[x] 埻潊 [xX][^x] 埻潊 [^xX]

套悩弄滯庖桄臯星懘对陉. 启嘪䫘 ^ 䔇桹拸嚓臘膆嚟儖愩誩婉嚔对陉桄臯庖严(認湙对陉儌䂺凹婉嚔虘桄臯鍴麂溼彍臘膆嚟滯䇞婄垬毐庖認湙䔇愙喕)幽婫 ^$ 鍴庖彖彆对陉庖严婾嚔崘启䂷儆幋崡誻儖彖彆对陉桄臯劯麵启嬉麵䔇䷺庖严婾㔗嘖滇 ARE 锄锩 \A\Z 傉䇽对陉庖严婾䔇嚔崘启䂷儆㔗

套悩弄滯庖鄘彖桄臯星懘对陉闼幽垄嘌巉 . 启桹拸嚓臘膆嚟認婻施唍启桄臯星懘对陉婔湙嘖滇婉嘌巉 ^$

套悩弄滯庖埉蘸桄臯星懘对陉闼幽垄嘌巉 ^$ 嘩䫘启桄臯星懘对陉麯婔湙嘖滇婉嘌巉 . 启桹拸嚓臘膆嚟㔗認婻澇傔幽崻崔䫘锫埻滇婺庖凹䓄柊冕䔇㔗

9.7.3.6. 鍊彽启噚垹攓

婘認婻垂䯄麯凹溼彍臘膆嚟䔇阪庥澇橬䬹彆䔇鍊彽嘖滇闼底婯橕脘崘橬冽喘䓂洉臯䔇䘋废庫臖镪噉喍轙誺 256 庖誗䔇溼彍臘膆嚟 啹婺 POSIX 噚垹䔇垂䯄埇傖拐䂺毖埖認湙䔇溼彍臘膆嚟㔗

ARE 垂鍙婪启 POSIX ERE 婉噚垹䔇嫇婔䔇䬹攓滇婘桹拸嚓臘膆嚟麯 \ 幽婉崌寂垄䬹枪䔇劆幬㔗欔橬噽垄 ARE 䬹攓鄘嘪䫘婘 POSIX ERE 麯麵滇麂濘潡蔙滇橻垔幬㔕橻弄滯昽悩䔇臺濘毺䴺単䔇 *** 儌滇喉 POSIX 䔇 BRE 启 ERE 幋崡䔇臺濘㔗

螩崔 ARE 欷匘鄘滇傯 Perl 闼麯唘準䔇嘖滇橬底潏啔庖媞櫹橙䊖庖婔婋傖埪婔底 Perl 麯澇橬庺䯄䔇欷匘㔗襕濘懟䔇婉噚垹寙拸 \b, \B 凹䂷儆䔇桄臯䚺幟䬹彆䔇崇䊖凹闼底桄臯星懘对陉䔇鍇媹䔇臖阊桹拸嚓臘膆嚟婘嬉䂂亥溘麯凹婖拸嚓启桹拸嚓嚘䫘䔇鍊彽傖埪橔阪/橔䘺对陉(蔯婉滇丸婔对陉)臺幬㔗

PostgreSQL 7.4 幋嬉䔇䬽橸麯䔇 ARE 启 ERE 庻婘婴婻麂婩滆菖䔇婉噚垹

  • 婘 ARE 麯劯麵虘五婔婻庖應昄庖䔇 \ 襕幽滇婔婻锄锩襕幽滇髍臇嘖滇婘傖嬉䔇䬽橸麯垄埻滇喍闼婻庖應昄庖䔇埥崡婔䓉桹濘㔗認婻庫臖婉滇傔幽閞鵻啹婺婘傖嬉䔇䬽橸麯澇橬傔幽寘啹螷潏傸喍認湙䔇废彖㔗

  • 婘 ARE 麯\[] 麯誻滇婔婻䬹枪庖严啹溴婘桹拸嚓臘膆嚟麯䔇婔婻桺橸 \ 媙釂喍潊 \\

荘䇽認底寺彆凹崓崔昄庫䫘鄘準臘鄘埇脘婉滇閞鵻嘖媙襕施嘹埇傖锔誺儖 regex_flavor 螆䘞婺 extended 準镪噉認底閞鵻㔗

9.7.3.7. 嘺橸溼彍臘膆嚟

BRE 婘庹婻桹麵启 ERE 婉崻婔湙㔗|, +, ? 鄘滇捞锔庖严垄傸澇橬京昽䔇媘脘敪扵㔗评啘䔇彖锫严滇 \{\} 啹婺 {} 橸躆滇捞锔庖严㔗啯喖䔇床臘膆嚟䔇婖拸嚓滇 \(\) 啹婺 () 躻躆滇捞锔庖严㔗鍴麂婘溼彍臘膆嚟嚔崘潡蔙滇婖拸嚓儕輙䔇床臘膆嚟嚔崘^ 鄘滇捞锔庖严鍴麂婘溼彍臘膆嚟䂷儆潡蔙滇婖拸嚓儕輙䔇床臘膆嚟䔇䂷儆$ 滇婔婻捞锔庖严蔯套悩 * 庺䯄婘溼彍臘膆嚟嚔崘潡蔙滇婖拸嚓儕輙䔇床臘膆嚟嚔崘(嬉麵埇脘橬 ^)闼幽垄滇婻捞锔庖严㔗橔劯埇傖䫘剘昄庖䔇劯嚘䫘傖埪 \<\> 彖彆滇 [[:<:]][[:>:]] 䔇劯幬臉澇橬噽垄䔇锄锩㔗


劯锔饡釕嬉誕
嘉婾庘昄启淉嘩严婪婔亓昄扞䌂傋湚嚟寡庘昄