Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1.Give me a RegEx and the replacement string which takes a list of NAMES and replaces them with last, first and deletes any middle names.

1.Give me a RegEx and the replacement string which takes a list of NAMES and replaces them with last, first and deletes any middle names. Example list:

First Last First Middle Last Benny J. Hill Samuel L. Jackson Fred Flintstone 

Example output:

Last, First Last, First Hill, Benny Jackson, Samuel Flintstone, Fred 

2.Create a simple blank HTML page (that is valid, meaning: html,head,body,title tags; using the DOCTYPE from the previous assignments etc.) 1st item on the page will be your RegEx and replace string from previous problem. Put it into a

 tag. 

3.Create a select tag for a drop down menu for States. to keep your validator happy, you may want to put a form tag around it but I don't care (but validation errors means I will actually read your source.)

4.The following list is what you'll use to create all the options for your select: image text in transcribed

AL Alabama AK Alaska AZ Arizona AR Arkansas CA California CO Colorado CT Connecticut DE Delaware FL Florida GA Georgia HI Hawaii ID Idaho IL Illinois IN Indiana IA Iowa KS Kansas KY Kentucky LA Louisiana ME Maine MD Maryland MA Massachusetts MI Michigan MN Minnesota MS Mississippi MO Missouri MT Montana NE Nebraska NV Nevada NH New Hampshire NJ New Jersey NM New Mexico NY New York NC North Carolina ND North Dakota OH Ohio OK Oklahoma OR Oregon PA Pennsylvania RI Rhode Island SC South Carolina SD South Dakota TN Tennessee TX Texas UT Utah VT Vermont VA Virginia WA Washington WV West Virginia WI Wisconsin WY Wyoming AB Alberta BC British Columbia MB Manitoba NB New Brunswick NL New Foundland NS Nova Scotia ON Ontario PE Prince Edward Island QC Quebec SK Saskatchewan 

1.go to a scratch file

2.paste in the list

3.Go back to your SELECT in your html. Create the 1st item only into html (Alabama ignore USA for now.) The option tag needs a value for the server program: ideally a code that doesn't translate... like the state abbreviation: "AL" for Alabama. Then you'll also need the text the humans read: Ideally the full name and abbreviation, as shown in the photo.

I think it may be better if you put the abbreviation before the full name design wise: "AL Alabama" or "AL - Alabama" you decide. Thinking about how I search those drop downs, I tab into them and type to scroll down the list then use arrows. But skimming is faster for 2 letters if they are consistently easy to spot... All are 2 letters wide so everything ends up into 2 nice columns. Get what I'm saying? It's hard to think about such things when you are in the middle building something!

6.Using the HTML you have now, you know the output you want to create and you can see in the scratch file your input text... you can search and replace and convert this whole list in ONE regex!

1.Find 2 letter states 1st. find multiple times to make sure that works. group the 2 letters because you'll need them to replace later.

2.Now find the state name as well. Using spaces is nice but Canada has a 3 word province. There are multiple ways to find the rest of the line. Once you get it matching each line when you find then you group the state/provice names with (). You'll now have 2 () you can reference. ..or maybe more () if you used them for your search.

3.Replace. start just doing 1. and undoing it. make sure it works. the replace will be your HTML you used for Alabama. but replace the name with \1 and \2 (or $1 and $2.) Make sure it works. undo. then replace all. DONE! go put it into your html.

4.Give me your RegEx and replace strings in a PRE tag below your select.

7.To get USA and CANADA groupings in your select... look up examples of select tags. There is a special tag for grouping options, when you find it.. then look up that tag in a reference for any details.

Choose Choose in USA Alabama (AL) Alaska (AK) Arizona (AZ) u Arkansas (AR) u Colorado (CO) IDelaware (DE) California (CA) Connecticut (CT Heria 01) Georgia (GA) r Idaho (ID) to llinois (IL) Indiana (IN) lowa (IA) Kansas (KS) Kentucky (KY) Louisiana (LA) Choose Choose in USA Alabama (AL) Alaska (AK) Arizona (AZ) u Arkansas (AR) u Colorado (CO) IDelaware (DE) California (CA) Connecticut (CT Heria 01) Georgia (GA) r Idaho (ID) to llinois (IL) Indiana (IN) lowa (IA) Kansas (KS) Kentucky (KY) Louisiana (LA)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions