O
O
Oleh2017-02-18 01:08:24
Java
Oleh, 2017-02-18 01:08:24

Your java regex method without pattern?

Hello! At school, they issued a task in which you cannot use the pattern method built into java and you need to create your own regular expression handler. The task is: A parser that uses simple regular expressions entered from the keyboard containing control constructs. – any character, * - 0 or more characters, + - 1 or more characters (a regular expression and a string are entered, the result is the position from which this expression occurs in the text)
Matcher can be used to search in the text. I would be glad for links on the topic of creating your own regular expression handler

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2017-02-18
@linkinkov

Regular expressions are equivalent to a state machine. The steps are as follows: find / describe the grammar of regular expressions yourself. According to the grammar, write a parser. Convert regular expression to DFA. Interpret the resulting DFA with a particular input.
https://m.habrahabr.ru/post/166777/

V
Vadim Dunkin, 2017-02-18
@vadimushka_d

Matcher without Pattern somehow doesn't work, so don't even look in the direction of Matcher.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question