SimpleRegex / SRL-PHP

Simple Regex Language
https://simple-regex.com
MIT License
1.8k stars 112 forks source link

What can come after "if already had/followed by"? #34

Closed ghost closed 8 years ago

ghost commented 8 years ago

Do they accept both SR expressions and strings? Do parentheses after them required?

I'm trying to write the parser, but can't precisely figure out the syntax of lookarounds.

KarimGeiger commented 8 years ago

Yes, they - just like groups - allow either literal strings without parentheses or a new sub-expression in parentheses.

ghost commented 8 years ago

I think, using strings without literal is not a good practice. And it makes difficult to parse the expression. What do you think about that?

KarimGeiger commented 8 years ago

Well, since your syntax has differences to SRL anyways, feel free to alter it. You could of course deny that shortcut, but it just makes the expression more verbose. Since the strings in that context can be seen as parameter, it's already used in other methods at SRL as well and thus not a "deal breaker", at least in my opinion. See one of for example.

ghost commented 8 years ago

I'm trying to follow syntax rules of SRL as much as I can :) but I have my own synonyms for some keywords. For now, my implementation has only one real difference: until is not supported. Anyway, thanks for answers :+1: