You are on page 1of 12
DURGA SOFTWARE SOLUTIONS SCIP MATERIAL | oe enc a Rey ak Exphusion wepruenti a group + Stings ace Ading bo pertiiles pallern. 6] €2O: We can waite a regular expresion te aepryenk aU valid ‘ Mobil numbert. e7 We can wet a wegalan, eaprevion te repre all vali reall J tale ([O THe main impotent appitection ateas of Aglad exprerston ate t 4. To dewelep vaidation dromecodee oO 2 Te develop pattem metching applications C fo Windewie, Feep in unex) gq S. Te develop bran datons Like compiles, Totrpreléc , assemblers ote! To develop digital ciacuily, i S To develop communiestion protecel ete ea: import java. util. eget. HS oO cls Rey Ex Demo 4 ff c QO 2 ayes) ie fab court =0 5 Pactlern p= Pattern. compile Crab); Madeher me p-mnedehr C% abbabsta’); whileCm. finder) ( county t Scop Cor. stereo tenet. ended 8. te rmgronply); U ® So p(' The vo O occurences + count); r ey PLOT NO.56, HARSHA CHAMBERS, SAI NACAR.NEAR BIG G MOBILES, MADHAPUR-500034, MOBILE:9505905786 ek DURGA SOFTWARE SOLUTIONS op: 0... 2... ab Bees 5... ob ne ee SCIP MATERIAL The no. of oceuramess +5 Rather clas > AL Pattern objed fe compiled Tepresentation of rua enprenfon int, Pettem objet Be Tawa egutvalent cfovn of regular. expression }> He con create. a Patter otjek” by uring compli) rnetiod of Pettero dos __ poulcc static Pitter compile-C Shing | Padtern pa Pattem.compile Cob")s Matcher clas: — 7 Se mndcher object con be tect te match Ha given pattern to the hi We can create Matene oleh by using matchuic) methad of Pattern eu }ER Males map. matcher CYabbacbaba')5 Rec Bf Melba olesy A) beotion find) ¢ Zp atlempte te dinel nent mete + weliinas bwe ah the mel te avaclable olkitwice vebiivny folie. 4) Int Stantey ¢ vebiims staat inde of matehecl pattern D fre ent) 1 vellivns emda Indo Of mudehed) pallor *) String groupes t aolterne mutehed pattern, Note Pattern 4. Matcha clase ane presert fin java util. regen package § thie cletser introduced fy Ja version, ‘PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905766 Q = DURGA SOFTWARE SOLUTIONS SCJP MATERIAL | cherects clases — [abe] — > fin cal ot IL) & vc! Mabe} —> ence al oA SL Ao! [a-zJ ——» Argyle cae alpha sg mbel drm atten CA-zJ 9 Pry upper cate atphahel pmol feom A tz. Caeh-z] > Any alphabet symbol Cea] —> oligit- from o-4 CaaA-Ze-9] 5 _ alphanumeric characte Da-wA-zo-4] —» Any Sptetal characte, SE Pattern pe Mathero.comgile Cx"); Mekhi. m = p. moto C’ aabezrtth"); rohit. finder) a S.0.pCm. start) +... Stem. qroupt)), Aefabey | A= Croke] | a=Ca-zJ | aefo-al | az(axzd-zo4] Vee oo tee ° a 3.1 -@ oe 5 1 eee Aree 2. eg Beek e Gee 5 tere k Heeck Ae (a-xA-Zo-4] 34.6 6+ ab PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 3 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL ‘PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 _ _ - DURGA SOFTWARE SOLUTIONS SCJP MATERIAL Pae-defineal charactoy cletses t— \s—s Space chatalih _ \S > ty chatastin. aupt space \d— Any digit from 0 £9 \O —> Ang chatact, euipt otigit oe Any woehel chat, Care A? 2-1] lw —> Spreial character > Ang choroslie inclucling specie chatactine alte. EX Pathe po Ruther, compile Ca"); Matchut ma pemetehea Cast Keaz"); WhiL-Cm. finde) Spm. stastOt ten.qeupor)), aes | a-Ns } aed - 7 Sal4) a=np| awe | actu) an. _ ae | oa 2 \2 oo 1 Geog folk ole + Dane . rae 3 wok e oe mee Merek [oe eek z. a be] b..69 e ‘ s. o _ ea _ Quarhifies 2— J We am ue Quackitiers ty speciby ne of cccuvramnens ty match. a > racy om a OF > Aaa ore a AF __5 Amy wo op a's Including ero number alio- 02 —>_ Abt ore ‘PLOT NO.56, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905786 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL : SBE Patten pe Retleen, compile("ar); Matchen m= pe mates 0% abaaat")5 ae Om. finder) Sop Com seat 4%, Mrmn qeoupo)s | y = anak a ° ene o. ne ' le 3. Reson ae t 5 4 | 1 Seaca |} 4 & Se e. cio & E Fathom cles spitcy meted — > Pattern clay ebtains eplites metsef “te split the given Shiv ened to ziven Retlern (regular enprestion). | VO Pattern p= Patlern. compile C™\\4")5 Shiegeg Le Pe Split” Dadge Coftrone GaAvdieng”); uC Sting a2) SOP CAI —> OP: Detye + Lope one . Setition Ose .4” EO! Paton po Pattom. compile" No), - 7 Haley $409 =p. cpl C* wus dyn Sefts cont); FA (String sae) Ls. pls); 9 2p soe audagaclott com’ ‘PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE9S0S905786 a —— [P Statey dais also Contatns eplite) method te oplit tha given batget StringTorenizer i DURGA SOFTWARE SOLUTIONS SCIP MATERIAL Staing clos Splitts mettiad 2— | | Giieg according te a pastidules pete. i String €= “wns Ausge copt. corns Shing I Sh s.optit(* ca"); dA (Staing soi et) Scop (42); > alps wove Se acest: aoe = Shiva clois spite) method tan take Tegudon enpres sion as sgument, Weheve as Patio cla Splitc) meted cam take bey © ay gumenk: > Bris a specially clecigned clan d& tobeni zation acti > Eb pryent th java. til paslooge. =O: Stang Toteenines fbened STC* Date Sephowe Sobcbtena"); bile Let. haa More ToleensL)) S-o-p (ck nentTokenc)); —> elp : Darga y Settee. Seratiions Neti: The Aefaubl regula emprenion — fot ee) Tohonineh Cf gpate chevoattr, ae: StringTokeniner stenew STC 49—o2—anaz' 1"): volile (sh. hasMove Toker ly)? i] Adie fetgek pastor S.oplstnertTolenc));—> oly 229 | ou: at Rod PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE,9505905786 6 DURGA SOFTWARE SOLUTIONS ‘SCJP MATERIAL CULL ——r—— oh mepresd ol valid to digile mobile numbers. AL Et shenld coutain enaitly w aligite 8) Shed Storte iG + o& & AG, cht Ca] Cen De 1) o-4) fo Lo] Lo Loa] Co 9] Loa] a) Ca Load fa} Bie GU ela a Ol Ce a Loa ia} toneltgit: GA) Mctegit (oly ta—adegit -— Coli)? C+ J fe-a7 fay igh hy We aig tA) a meigit (A) cheval 2— (ol c+3741)? C+ Coa La} Hvinite a rqulan eaprerdion ‘to repremut all valid mail ile, [Caza-z oa] Cann-20-94. J @Carazoas’ (C3 contet) | Wweite a regular eapression be reprejed at valid ideatibions Of er KAVA hamatnago. Rates 2 1) The aWlowed chovachia ave atx, Abez,0b9, #,_. 2) The demas Of Fear bik thenld toe acblenst 2. 2) The first chavect shod be lower cae alphatel tymbet from atek. 4) Seconad chevactii, thentd be a agit Ai be bys, (ak (0364) [a-z TST WOT Hanes CUEENS STAGHNEAR ONC NOBLES HADIAPOR STOTT NOUUESEEIOETO L a DURGA SOFTWARE SOLUTIONS SCIP MATERIAL Wwoitr a vapor expression te creprreyedt- oll valid nanes chertr eof ‘al amd end wilh OH! Cecttan Lowercare of ceppcare), (4A Ce m J" Eand [Jrrite a pryrem be chek whetr tk given no. is a valid mobile mo. A nok. Fenpodt- Jowa. Ail. regen. es chars Teak t Pos ov mH) t » Pattern p= Pacorn, compile-C* (olay) 2 63-13 Lo-13 £99) Matcher. m= p. matcher (args Co); af On. Finded gg mm. qroupt ).equets (orgs co3)) Sop (8 valid mobile nermber')s be p (*Envakil mobi. numbert} er: jova Tet 4666666669 Jeva Test 909292429242.-~ Jove Tee 92-929292929242 X wit a pregran to check helt given mail fA te valid o& not: En the above program ne eveto replace reli. no. meget expremion vith malt fd regular eaprenion. ~ * [a-zA-z0-1] [a-x A-Z0-9.._J @ fa-zA-Zo-a}* (LI conent) | PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-S00034, MOBILE:9505905706 s DURGA SOFTWARE SOLUTIONS SCJP MATERIAL [] woite @ program ty extract a mobile noke preect in the given Top die whee mobile net mined wit newmal tert dota Thi Fe Dukge wits mobile number : ASOSH1G0 40 and mat! Td: ded9p © gmail com 450541 8040 aanargnar This is Chive Wii mobile number: Parmar, amd matl tat inputs bal import java-To-¥s Tnnpost java. wtil regents clay Test { “a Pos v ME) throne Eruption Pattern pe Pathrn. compite (* Cola) ?£4-0J Lo-a Lay )5 PrintWaite. poe new Phl (output but); BufferedReader br anew eR (new FRC input tat”) 5 Shing Mice br sendlinecy; vohile (tine | =nutl) ie Madch ev m= pemalche (Line); wk Cm. dincter) Peo. pri tin (m- grouper); Lines ler. geaalLinet); Pe Huth; y J Pe. deter, ‘PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 DURGA SOFTWARE SOLUTIONS SCIP MATERIAL | Uf borite a program te enteect oll mail Tall prised in the given Inped file. |—> fn te above preqram, We have te seplace mobi no. aequlew erprenion wait mail 1d seule eaprevsion, $ [o- wA-Z0-4) (a-zA-2.0-9._F*@ Ca-zA-2 0-4) (C-ILA-RA -2')*) I waite 0 Program do print names yal skat tile names pryent fo eh dra. choc, (-2A-zo-a} Caz A-z0-9. 81°09 oe] import jova. to. as impor joven utile wipe. ks Aes Taste 4 Pos v mest Excaptton L Pectiern pe Pattern. compile (Ea-2A-Z0-nJ [az File Gene Fie (*et\duage clos"): SHigCa ced bitor; Sac Sting S45 3) L <4 > FO8e SEE ors “Models mepemeteh Cot); $m dindes &# m.gaoupt d- equals (£4) Yop 54.9; ‘PLOT NO.S6, HARSHA CHAMBERS, SAT NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 10 DURGA SOFTWARE SOLUTIONS SCJP MATERIAL ' PLOT NO.S6, HARSHA CHAMBERS, SAI NAGARNEAR BIG C MOBILES, MADHAPUR-500034, MOBILE:9505905786 n

You might also like