(Solved) : Write Javascript Function Match String Starting Ab Ab String Either Start Ab Ab Followed C Q42765116 . . .

Write a javascript function to match string starting with.AB or AB

The string should either start with .AB or AB followed by anycharacters.

i am getting confused how to form regular expression and techand match using function . the string should match with the firsttwo characters AB or first three characters .AB then only alertstatement(“string is correct”) otherwise alert statement (“Stringis not correct”)

input1 : .AB2e234324

output: string is correct

input2 : AB44r4r44r

output: string is correct

input3 : ABdsfdsfds

output: string is correct

input4 : AfB.dsf3

output string is incorrect

=======================

The language is Javascript.

Expert Answer


Answer to Write a javascript function to match string starting with .AB or AB The string should either start with .AB or AB follow…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?