Question: Write a program in JAVA only to match a pattern from a given text file. You should first prompt the user for the file name
Write a program in JAVA only to match a pattern from a given text file. You should first prompt the user for the file name (e.g., story.txt) and the pattern (e.g., Aladdin). If the file doesnt exist then print an error message to the user and prompt for the correct file name. Your program should find all the matches and show the position number for each match. When youre matching a pattern, make sure that its not case sensitive (e.g., text An and pattern an is considered to be the same).
Pattern Matching Algorithm: Jsers should have the option to match multiple patterns from multiple files without terminating he program. dditional Requirement: Use an appropriate Exception Handling Mechanism
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
