regex_match function - IBM

文章推薦指數: 80 %
投票人數:10人

execute function regex_match ('Regex module' , '[Mm]odule|DataBlade'); (expression) t. In the following example, the regular expression 'wo[ou]l?d' matches ... IBM®Informix®12.10 regex_matchfunction Theregex_matchfunctionreturnsindicateswhetherasourcestring matchestheregularexpression. Syntax regex_match( strlvarchar, relvarchar, coptsintegerDEFAULT1) returnsboolean regex_match( strclob, relvarchar, coptsintegerDEFAULT1) returnsboolean Parameters str Thestringtosearch.CanbeoftypeCHAR,NCHAR,VARCHAR,NVARCHAR,LVARCHARorCLOB.Anull valueistreatedasanemptystring. re Theregularexpression.CanbeoftypeCHAR,NCHAR,VARCHAR,NVARCHAR,orLVARCHAR.Cannotbe null. copts(Optional) Thetypeofregexsearch:0=Basicregex 1=Default.ExtendedPOSIXregex 2=Basicregexandignorecase 3=ExtendedPOSIXregexandignorecase Description Usetheregex_matchfunctiontodetermineifthesourcestringmatchesthe regularexpression. Returns t=Thesourcestringmatchestheregularexpression. f=Thesourcestringdoesnotmatchtheregularexpression. Anexception=Anerroroccurred. Example Thefollowingstatementtestswhethertheword"module","Module",or"DataBlade"occursinthe string:executefunctionregex_match ('Regexmodule','[Mm]odule|DataBlade'); (expression)t Inthefollowingexample,theregularexpression'wo[ou]l?d'matchestheword "wood"andtheword "would":selectid,twister fromtongue_twisters whereregex_match(twister,'wo[ou]l?d'); id286 twisterIftwowitcheswouldwatchtwowatches,whichwitch wouldwatchwhichwatch? id335 twisterHowmuchwoodcouldawoodchuckchuckifa woodchuckcouldchuckwood?Awoodchuck couldchuckasmuchwoodasawoodchuckwould chuckifawoodchuckcouldchuckwood. Parenttopic:RegexRoutines Examplesexchange| Troubleshooting TofindthePDF,seePublicationsfortheIBMInformix12.10familyofproducts. Forthereleasenotes,documentationnotes,and/ormachinenotes,seetheReleaseNotespage.



請為這篇文章評分?