Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part I: PostgreSQL With Regex Exercises: Q1: Select all records by defining a Regex pattern. (Hint: define a pattern that can match all Crimeid) Q2:
Part I: PostgreSQL With Regex Exercises: Q1: Select all records by defining a Regex pattern. (Hint: define a pattern that can match all Crimeid) Q2: Return all those crime details from the table for which the Crimeid field starts with an uppercase character. Q3: Return all those crime details from the table for which the Crimeid field starts with two digits. Q4: Extract all the street name from location column. (Hint: return the substring after 'on or near') Q5: Based on the street names that extracted from Q4, return the Top 3 places that have the most criminal records. Part II: Advanced Regex Exercises: Q1: Write a Regex pattern to match all films produced before 1990. Test String: The Shawshank Redemption (1994) The Godfather (1972) The Godfather: Part II (1974) Pulp Fiction (1994) The Good, the Bad and the Ugly (1966) The Dark Knight (2008) Q2: Write a Regex pattern to Match 24-bit hexadecimal colors. Skip 12 bit colors. You only need to match the code part, such as, #F0F8FF. Do not match the words. Test String: Next Page 24 bit: AliceBlue #F0F8FF AntiqueWhite #FAEBD7 Aqua #00FFFF Aquamarine #7FFFD4 Azure #F0FFFF 12 bit: White #FFF Red #F00 Green #0F0 Blue #00F Q3: Write a Regex pattern to match lines that are more than 30 characters long. Test String: This line is way too loooooooooooong. This one is fine. This one is fine too. This line is also too long................ Q4: Some words in this text are accidentally repeated. Please write a pattern to find them. Test String: It was a chilly November afternoon. I had just just consummated an unusually hearty dinner, of which the dyspeptic truffe formed not the least important item, and was sitting alone in the dining-room dining-room, with my feet upon the the fender, and at my elbow a small table which I had rolled up to the fire, and upon which were some apologies for dessert, with some miscellaneous bottles bottles of wine, spirit and liqueur. In the morning I had had been reading Glover's "Leonidas", Wilkie's Wilkie's "Epigoniad", Lamartine's "Pilgrimage", Barlow's "Columbiad", Tuckermann's "Sicily", and Griswold's "Curiosities" ; I am willing to confess, therefore, that I now felt a little stupid. Q5: Write a Regex pattern to match numbers containing floating point. Skip those that don't. Test String: Speed of light in vacuum 299792458 m/s Standard atmosphere 101325 Pa Earth to sun distance 149600000 km Acceleration of gravity 9.80665 m/s^2 Circumference to diameter ratio 3.141592 Gas constant 8.3144621 J/mol*K
Attachments:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started