https://github.com/sejalmankar1012/customregexmatcher
This Java program checks if an input string matches a custom regular expression pattern. It supports alphanumeric characters, '.', and '*'. Just compile and run the program, follow the prompts to input the regex and string, and see if they match.
https://github.com/sejalmankar1012/customregexmatcher
Last synced: 7 months ago
JSON representation
This Java program checks if an input string matches a custom regular expression pattern. It supports alphanumeric characters, '.', and '*'. Just compile and run the program, follow the prompts to input the regex and string, and see if they match.
- Host: GitHub
- URL: https://github.com/sejalmankar1012/customregexmatcher
- Owner: sejalmankar1012
- Created: 2023-08-06T13:45:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-06T13:47:47.000Z (about 2 years ago)
- Last Synced: 2025-01-26T04:27:46.019Z (9 months ago)
- Language: Java
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CustomRegexMatcher
This Java program implements a custom regex matcher that checks whether a given input string matches a provided regular expression pattern. The program supports alphanumeric characters, period (.), and the asterisk (*) wildcard.
## Usage
1. **Compilation**:
- Make sure you have the Java Development Kit (JDK) installed on your computer.
- Open a terminal or command prompt.
- Navigate to the directory containing the `CustomRegexMatcher.java` file.
- Compile the Java code by running the following command:
```
javac CustomRegexMatcher.java
```2. **Running the Program**:
- After successful compilation, run the program using the following command:
```
java CustomRegexMatcher
```
3. **Input Instructions**:
- The program will prompt you to enter the regular expression pattern. Enter the desired pattern and press Enter.
- Next, you'll be prompted to input the string you want to check against the regular expression. Enter the string and press Enter.4. **View Results**:
- The program will process your inputs and display whether the input string matches the provided regular expression or not.## Examples
Here are some example interactions when running the program:
```
Enter the regular expression:
a.b*Enter the input string:
abbbcThe string matches the regular expression.
```## Notes
- The program validates input parameters and handles edge cases according to the specified requirements.
- The matching logic includes recursive handling of the '*' wildcard.
- Feel free to customize the program, add more test cases, or modify the code as needed.---