B
B
brainflow2014-11-26 12:25:07
PHP
brainflow, 2014-11-26 12:25:07

PHP. Simplified language for users to write regular expressions?

Hello.
Please tell me if there is a ready-made library that would allow ordinary users who are not familiar with programming to write expressions for processing strings.
As an example: there is a line - A*.ee
The user writes "*." equal " "
The program interprets that A*.eee == Aeee
I know that it's time to get the "Interpreter" template from under the table and write everything yourself, but suddenly there is already an implementation with a bunch of stars on github, because laziness is the engine of progress.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
krypt3r, 2014-11-26
@krypt3r

Well, if Friedl's "Regular expressions" are not given in any way, then look in the direction of verbal expressions .
PS. Never used

S
Sergey, 2014-11-26
Protko @Fesor

The user writes "*." equal " "

Well, yes, it is much simpler and the user does not need to know regular expressions at all. The case that you described is a simple replacement, no regular expressions.
What?
In general, implementing your own simple DSL is not much of a problem. The question is what do you need to do. In general, regular expressions are easier to describe than they are. The question is only in the implementation of examples, previews of changes, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question