Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!