Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

JS Assignment 4

Javascript notes unit 4 sppu entc

Uploaded by

Madhura Peshave
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

JS Assignment 4

Javascript notes unit 4 sppu entc

Uploaded by

Madhura Peshave
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

PAGE NO PAGE NO.

DATE DATE

Q"2 Explan VaioLs Shinq methaclefirrcgular


ASSIGNMENT-4 expreAloh

Itqularexpuion and bau to creaie Javascript providu ceveal sting meboda


them that suppart tqular cxpratoni
Keqular Expaion RegEx) an padtrn eed to match O': Searhes ashinq tor a match
match chamckta combinatbni ln tingaTa agcinst a tgularcxpzsian and turn.
Tavaript and other paogramminglanguage atay Of the matches
wacd to Rearch it or oaniplat
bascd an specihc patlerne let str e The raln in Spain
let eaut = stmatch (lain l¡
A reqular Cxprcasian Can be created In tuo
replace U': Sear ches shinq fo a spcclied
a
value rtgular exprelilon aod returna
1 lainga itealnotathon This s ehelored bctween with the specificd vale (s)
slashee (lpaltezn /D placed

let eqex "Hello oldl


2 Laing he Re Exp conatuor 'This
hen yo hecd tn huiaa paltrn dypamially search O': Execute earchfor a matoh
between a tguar expsion and
specihed
Cirst
ctigg
oatch
I returns ihe der of the
In both casey 'tqer a qular opruion
let str "The rain in Cpain sta manly
the plan";
let Index ctr StazchCain)
aplit ()': Splits string nto
subtting uaing tgular cxpreauion
PAGE No PAGE NO

DATE DATE

let tt a "apple, banana cherty"; Example


let sut = ctr. aplit ( . \
let regex
test O': Tuts for a match in a string
Rctuecnd true'o fase canaole laqLut C), /Loold"
Let reqex = hello: but not captcd
hello"h matched but
Jet eaLt = reqex test/hello odld matched and captuzcd
" world a botb matched
exec O': Exccutea Search for a match i Anu Explain ath xample charackr

shang and ctirng amay dlasses


in fozmahionIt retuzns null' t£ na match
Characttr dasces in reqular exprtaion
al an far mathing peciic typea af charach
let neqex =/hello/ Spme Comman charactr cla4uee Jocluclei
let zeault = tqe. cAec ("hello wozld :
4Dot): Matcher a cingl charactr except
short note captuing in JS healine charack

Tn tquar expraLona, caphuing gups r let


let
regexult /at
eaed to qrnup pat ofa pattern and capbi -cat "matthltgex)
he match for later defaut
captuingoblch mean ated 2.dMalehes any diqit lo-9.
for later wee

Non-aptunq gDup at qznup ibat de let át = 2024match


Inot captut the math,nlaning ihu do not
store the oatchud content They g.\a': MatchL obrd chaxckrfalphanumeri
leohen you neea to qoup elemente but dont undenacos)
need to ston the
let
Tn Tava Sript non capturing gzaupi Jet zeH hello_toocd ".oatch (regex).
Crtatd uaihq
PAGE ND
DATE

Matche any htepace charackr Let st Hello klorld


Copocea. Hello Unierse
Hello Muttiverne
let vact Hella World mathlscge): let -/Hellalm
\bMatch e any nan-drgt charackr
aboecode
Ta the above th "Hdlla pattkrn
atch Helloat the startt of
star af cachJin
led aolt abe match (zt en) Lduu to th m'flag Th ulhll be the
AcstHello fomeach hoe
\WMatche ans nonsword chaxacer
let
ld acaultOns"matth (tgex)
\SMatohe any bon-whikespaca charachr
let
ledeulta "Hllo"match (rgex)
aJS code to pofform mulbhne
makching
To perfoxno mulhlin makhing
yaucan ñe he 'm laqTht flaq beay the
begiolbg CA)and end ( ) al the shing
thabegning and end of cach Line
Cxample

You might also like