Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help! Create a Java program that will accept a regular expression and a filename for a text file. The program will process the file,

Need help!

Create a Java program that will accept a regular expression and a filename for a text file. The program will process the file, looking at every line to find matches for the regular expression and display them.

The output from your program should be formatted like this:

Match found on line 10, starting at position 10 and ending at position 25: aaaaaaaaaaaaaa0

If the regular expression entered was a*[01]

And the input file contained at line 10:

Xxdsdsasdaaaaaaaaaaaaaaa0

Your program must implement its own regular expression functionality you can not use the built-in regular expression mechanism, nor can you include one from a package or JAR file unless you created it.

The following operators are required to be accepted:

+ - one or more of the following character (no groups)

* - zero or more of the following character (no groups)

[] no negation, no character spans the only format is explicit, for example [0123456789]

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

4. Describe cultural differences that influence perception

Answered: 1 week ago