Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solution needed in Python language . . O A regular expression is written in a very specific language, and its purpose is to define a
Solution needed in Python language
. . O A regular expression is written in a very specific language, and its purpose is to define a text pattern. One of the biggest uses of regular expressions is to detect specific text patterns within a larger text file, such as a log file. For example, you might write a regex to look for the specific text that represents an HTTP 500 error in a web server log file or to look for email addresses in an SMTP server log file. In this assignment your task is to parse an industrial benchmark and extract the following patterns: Read bench.txt file as input. Extract all the rows with the following pattern from the text file (by using regex): Pattern: I - inst[digit_number] [MACRO NAME] + PLACED ([X] [Y]) [DIRECTION] ; For example: - inst2591 NAND4X2 + PLACED ( 100000 71820 ) N; In this example: Digit_number: 2591 MACRO Name: NAND4X2 X: 100000 Y: 71820 Direction: N o O O O O OStep 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