flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > Hi,I need a code about C implementation regex please help me

Author
Thread Post new topic Reply to topic
kerr



Joined: 24 Feb 2016
Posts: 150
kerr
hello every one
I need a about C implementation regex ,I am difficult in the NFA and DFA algorithm, Has been unable to solve ,I would like to ask you help me .
The code found on Github is to difficult to understand , and pcre is too complex for me .

_________________
I hope we will be good friends.
Post 07 Apr 2019, 15:55
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
How about Russ Cox's Implementing Regular Expressions? I've not studied this at all, but I vaguely remember that Kernighan had some simple regex code for teaching.
Post 07 Apr 2019, 19:58
View user's profile Send private message Visit poster's website Reply with quote
kerr



Joined: 24 Feb 2016
Posts: 150
kerr
rugxulo wrote:
How about Russ Cox's Implementing Regular Expressions? I've not studied this at all, but I vaguely remember that Kernighan had some simple regex code for teaching.



I've seen this before.

_________________
I hope we will be good friends.
Post 08 Apr 2019, 14:53
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 875
Location: Colombia
pelaillo
The lua pattern matching is a subset of a regular expression parser and is a lot simpler.
Just download the lua source and open the file src/lstrlib.c. The functions for pattern matching are all grouped together. It is easy to understand and well commented.

Once you grasp the general idea, you are ready to move onto PCRE sources.
Post 09 Apr 2019, 18:19
View user's profile Send private message Yahoo Messenger Reply with quote
kerr



Joined: 24 Feb 2016
Posts: 150
kerr
pelaillo wrote:
The lua pattern matching is a subset of a regular expression parser and is a lot simpler.
Just download the lua source and open the file src/lstrlib.c. The functions for pattern matching are all grouped together. It is easy to understand and well commented.

Once you grasp the general idea, you are ready to move onto PCRE sources.


thank you , but i think i need JavaScript Regexp grammar.

_________________
I hope we will be good friends.
Post 11 Apr 2019, 05:26
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 875
Location: Colombia
pelaillo
Javascript Regexp grammar is like PCRE so all the complexity is back.

Mozilla implementation is in C++: SpiderMonkey
Post 11 Apr 2019, 13:01
View user's profile Send private message Yahoo Messenger Reply with quote
kerr



Joined: 24 Feb 2016
Posts: 150
kerr
pelaillo wrote:
Javascript Regexp grammar is like PCRE so all the complexity is back.

Mozilla implementation is in C++: SpiderMonkey


Yes , So I want to make a small Regexp for C language text processing.
"Spidermokey" Not suitable for C language .

_________________
I hope we will be good friends.
Post 12 Apr 2019, 06:07
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 875
Location: Colombia
pelaillo
Post 14 Apr 2019, 18:53
View user's profile Send private message Yahoo Messenger Reply with quote
kerr



Joined: 24 Feb 2016
Posts: 150
kerr
pelaillo wrote:
So, this is what you need: https://github.com/kokke/tiny-regex-c/blob/master/re.c


thank you !
I aiso have a copy of this document , but i don't know how to use error reporting in C language

warning: unknown escape sequence: '\w'

_________________
I hope we will be good friends.
Post 18 Apr 2019, 06:26
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.