Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable use of multiple patterns at the same time. #7

Closed
wants to merge 7 commits into from
Closed

Enable use of multiple patterns at the same time. #7

wants to merge 7 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 17, 2017

Enable use of multiple patterns at the same time. review 3

@kokke
Copy link
Owner

kokke commented Dec 11, 2017

Hi @komdivkote

I can't review all these changes at once. There is so much that has been changed, so I feel it has moved a bit away from the original project, with the dynamic allocation and all.

I do like the changes however and I would like to have both styles available in this library.
Is it possible for me to merge these changes to a separate branch?

I haven't had much experiencing using branches with PRs on Github...

@ghost
Copy link
Author

ghost commented Dec 15, 2017

I would like to have both styles available in this library.

I have two branches in the forked repo i.e master an freebsd. I also have limited expirience with github. I was working a lot with SVN.

@ghost
Copy link
Author

ghost commented Dec 15, 2017

By the way, I have noticed that the branching code is causing recursion when the
else if (pattern[1].type == BRANCH) { return (matchpattern(pattern, text) || matchpattern(&pattern[2], text)); }
and working generally incorrectly. For example, regex '^abcd|abdc$' applied on the string abdc will fail because the '|'-branch will never be reached.
Also there is lack of the grouping '()'. For this reason the branching is not possible to use. I tried to implement grouping but it is quite complicated.

Also in function __re_compile_count there is improperly length of the objects list calculation, I forgot that the '' is an escape character and does not require space in array.
`
while (pattern[i] != '\0')
{
c = pattern[i];

    objs++;  

    if (c == '\\')  
    {  
        i+=2;  
        continue;  
    }  

`

Unfortunately, on the complex regex expressions using interactive matching, it still requires large stack, so I have to develop the code almost from scratch and will not be able to make further commits.

@kokke kokke closed this Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants