-
Notifications
You must be signed in to change notification settings - Fork 178
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
RegEx gets no match #93
Comments
Did you lose a character when copying it?
[ 5 ] phdyex @ xps-ne ~/play/tiny-regex-c/tests
$ gcc -I.. -c test7.c
test7.c:21:31: error: expected expression before ‘^’ token
21 | char * pattern = "/([^=,])=("[^\"]"|[^,\"]*)/";
| ^
…On Wed, Dec 18, 2024 at 8:09 AM wills721 ***@***.***> wrote:
Using this pattern:
char * pattern = "/([^=,]*)=("[^\"]*"|[^,\"]*)/";
I do not get a match on this data:
char * data = "aa=88,bb=99,cc=77";
Any help would be appreciated :)
—
Reply to this email directly, view it on GitHub
<#93>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIQYKD2TPWX5NIITEPPRTST2GFXZ3AVCNFSM6AAAAABT2VPREGVHI2DSMVQWIX3LMV43ASLTON2WKOZSG42DONZXGU4DIOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
char* test_vector[][4] =
{
{ OK, "/([^=,])=(\"[^\"]\"|[^,\"]*)/", "aa=88,bb=99,cc=77", (char*) 0
},
};
$ ./tests/test7
type: CHAR '/'
type: CHAR '('
type: INV_CHAR_CLASS [=,]
type: CHAR ')'
type: CHAR '='
type: CHAR '('
type: CHAR '"'
type: INV_CHAR_CLASS ["]
type: CHAR '"'
type: CHAR '|'
type: INV_CHAR_CLASS [,"]
type: STAR
type: CHAR ')'
type: CHAR '/'
[1/1]: pattern '/([^=,])=("[^"]"|[^,"]*)/' didn't match 'aa=88,bb=99,cc=77'
as expected.
0/1 tests succeeded.
…On Wed, Dec 18, 2024 at 12:28 PM Philip Dye ***@***.***> wrote:
Did you lose a character when copying it?
[ 5 ] phdyex @ xps-ne ~/play/tiny-regex-c/tests
$ gcc -I.. -c test7.c
test7.c:21:31: error: expected expression before ‘^’ token
21 | char * pattern = "/([^=,])=("[^\"]"|[^,\"]*)/";
| ^
On Wed, Dec 18, 2024 at 8:09 AM wills721 ***@***.***> wrote:
> Using this pattern:
> char * pattern = "/([^=,]*)=("[^\"]*"|[^,\"]*)/";
>
> I do not get a match on this data:
> char * data = "aa=88,bb=99,cc=77";
>
> Any help would be appreciated :)
>
> —
> Reply to this email directly, view it on GitHub
> <#93>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIQYKD2TPWX5NIITEPPRTST2GFXZ3AVCNFSM6AAAAABT2VPREGVHI2DSMVQWIX3LMV43ASLTON2WKOZSG42DONZXGU4DIOI>
> .
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
|
I had the escape chars wrong.....but you show the compilation working (I got that to succeed).....not the matching? Should re_matchp not have picked out aa and 88 and bb and 99 ... ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using this pattern:
char * pattern = "/([^=,])=("[^\"]"|[^,\"]*)/";
re-compile passes but I do not get a match on this data:
char * data = "aa=88,bb=99,cc=77";
Any help would be appreciated :)
The text was updated successfully, but these errors were encountered: