flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > re4asm - regular expression engine

Goto page Previous  1, 2, 3  Next
Author
Thread Post new topic Reply to topic
tantrikwizard



Joined: 13 Dec 2006
Posts: 142
tantrikwizard 16 Feb 2007, 01:01
f0dder wrote:
I took a brief look at Gold Parser some years ago, looked interesting, but never got around to using it. Not really a replacement for a RegEx engine either, imho.

Anyway, the assembly engine implementation looked pretty trivial, I wouldn't be surprised if it's actually beaten by a decent compiler; would be interesting to see some speed tests.


Yea its a different sort of monster from a RegEx. The performance is pretty bad in the engines I've used, I imagine the asm engine doesn't perform so well either. But for its purposes it works pretty well.
Post 16 Feb 2007, 01:01
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
mrpink



Joined: 03 Jun 2005
Posts: 27
Location: Germany
mrpink 19 Feb 2007, 09:17
Hello Ozzy.
Pelles C standard library actually does not use PCRE. (At least the version that I have.) It comes with (a modified version of) Henry Spencer's regex library.
http://arglist.com/regex

Hello f0dder.
Nothing is wrong with PCRE. Ignore this thoughtless and stupid comment. What I really wanted to say is that you should also consider other libraries. As
tantrikwizard already mentioned you should choose the library that suits your and your potential users needs. Using PCRE has a lot of advantages, for
example, everbody familiar with PERL will feel right at home with your application. It also supports portability of regexes between your application and PERL.

vid wrote:
Quote:
nothing is

Unless anybody provides a counter-example, it is error free code.

The current implementation status of regcomp is as follows:
    - leftmost longest match (returns start and end of a match)
    - leftmost shortest match (returns start and end of a match)
    - character classes
    - case insensitivity
    - backward searching
    - minimum match length

The next step is adapting regexec.

I think I'll release the next version on 02/28/07.

By the way, does anybody of you have an idea of how to identify the longest string that must occur in every match? I've heard that grep is able to do that and
then uses a fast exact string matcher like quicksearch to speed up the search.
Post 19 Feb 2007, 09:17
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8349
Location: Kraków, Poland
Tomasz Grysztar 19 Feb 2007, 09:45
mrpink wrote:
Unless anybody provides a counter-example, it is error free code.

And when someone provides a counter-example, it miraculously changes to bee an erroneous code, without having a single byte altered? Wink
Post 19 Feb 2007, 09:45
View user's profile Send private message Visit poster's website Reply with quote
mrpink



Joined: 03 Jun 2005
Posts: 27
Location: Germany
mrpink 20 Feb 2007, 07:48
Clearly, if somebody provides a counter-example then it actually has never been error-free code. Although I did not proved the code correct(yet), I'm very sure it is. Thus the claim. Smile
Post 20 Feb 2007, 07:48
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 16 Mar 2007, 04:11
mrpink wrote:

I think I'll release the next version on 02/28/07.


No hurry. Smile

FYI, xgrep 1.03 (DOS, 8086) is now available (soon to be officially part of FreeDOS?) w/ .ASM src. Hooray! Laughing

EDIT: Post #786 (via my P4, a so-called 786, heh).
Post 16 Mar 2007, 04:11
View user's profile Send private message Visit poster's website Reply with quote
0.1



Joined: 24 Jul 2007
Posts: 474
Location: India
0.1 25 Jul 2007, 10:53
I just saw it today!
Very impressive mrpink!

_________________
Code:
 o__=-
 )
(\
 /\  
    
Post 25 Jul 2007, 10:53
View user's profile Send private message Reply with quote
semiono



Joined: 31 Aug 2007
Posts: 192
Location: section '.code' executable
semiono 30 Aug 2010, 21:15
Thanks!
Post 30 Aug 2010, 21:15
View user's profile Send private message Reply with quote
mrpink



Joined: 03 Jun 2005
Posts: 27
Location: Germany
mrpink 09 Jun 2011, 19:04
hi there,

i've done some updates and extensions to the regex engine.

it now passes almost all tests in basic.dat from:

http://www2.research.att.com/~gsf/testregex/

code size is about 8.8k including the code needed for running
it as an egrep-like commandline tool.

if somebody is interested and has a real project to include it
or has an idea for its usage let me know.
Post 09 Jun 2011, 19:04
View user's profile Send private message Reply with quote
XVilka



Joined: 04 May 2011
Posts: 42
Location: Russia
XVilka 10 Jun 2011, 05:06
mrpink, I'm interested in this project, i'm working on using this library as tinypy module for KolibriOS. Please, upload here your new version. Thx for great work!
Post 10 Jun 2011, 05:06
View user's profile Send private message Visit poster's website Reply with quote
mrpink



Joined: 03 Jun 2005
Posts: 27
Location: Germany
mrpink 11 Jun 2011, 06:25
hello XVilka, what is your project about? please tell me a little bit about it.
maybe you can share your source code and we can work together to find
the best solution how to integrate my code with yours. you might need
some additional stuff like support for cyrillic/russian character set and
other regex syntax than posix ere.
Post 11 Jun 2011, 06:25
View user's profile Send private message Reply with quote
XVilka



Joined: 04 May 2011
Posts: 42
Location: Russia
XVilka 16 Jun 2011, 15:49
mrpink: i'm trying to implement system-wide module/lib for KolibriOS and tinypy http://redmine.kolibrios.org/projects/kolibrios/repository/show/programs/develop/tinypy
Post 16 Jun 2011, 15:49
View user's profile Send private message Visit poster's website Reply with quote
mrpink



Joined: 03 Jun 2005
Posts: 27
Location: Germany
mrpink 18 Jun 2011, 08:47
sorry but I still don't understand. do you need to call it from C? please
tell me a more about Your code Very Happy
Post 18 Jun 2011, 08:47
View user's profile Send private message Reply with quote
XVilka



Joined: 04 May 2011
Posts: 42
Location: Russia
XVilka 04 Jul 2011, 06:31
Sorry for big delay.
Yes. I need call it from C (or from fasm, if TinyPy will be rewritten on fasm). It is for implementing "re" module for tinypy. And of course, this library can be system-wide for KolibriOS, and for other its programs.
Post 04 Jul 2011, 06:31
View user's profile Send private message Visit poster's website Reply with quote
Antares



Joined: 23 Jan 2006
Posts: 4
Antares 15 Jul 2011, 16:05
If it supports most of the syntax, it has long desired solution. I have long waited for such a project, but unfortunately before they had very limited support for syntax.
Post 15 Jul 2011, 16:05
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 03 Nov 2011, 15:29
cool, writing coreutils in FASM? Smile

i'm in

ps.:
REGEXP rulz
Post 03 Nov 2011, 15:29
View user's profile Send private message Visit poster's website Reply with quote
mrpink



Joined: 03 Jun 2005
Posts: 27
Location: Germany
mrpink 12 Dec 2012, 17:55
Hi all. I've updated the code, added some features and renamed the package.
Check it out.
Post 12 Dec 2012, 17:55
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 12 Dec 2012, 20:09
Hi, mrpink.
I just downloaded your code. It is really impressive work. But I have some advices about your coding style:
1. Never use "fix" directive at all. It is provided for very specific tasks. The usual program should never use it at all.

2. Also, don't use "equ" to define numeric constants. Use "=" instead.

Actually in your code all numeric constants should be defined with "=". I don't know why you are using "fix" and "equ"???
Post 12 Dec 2012, 20:09
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
mrpink



Joined: 03 Jun 2005
Posts: 27
Location: Germany
mrpink 12 Dec 2012, 21:24
Well, when I started this project in 2007 I thought it is best to use fix
for constants you don't want to be overridden accidentally as fasm would do with constants defined with equ.
What are those very specific usages of fix you're talking about? I just thought, they're there for defining constants you wouldn't want to be redefined somewhere.
Anyway, is there any harm done by using fix and equ the way I did?

And thanks for your appreciation. I really like your work too. Keep it up.
Post 12 Dec 2012, 21:24
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 13 Dec 2012, 06:00
mrpink wrote:
Anyway, is there any harm done by using fix and equ the way I did?


It is relative, but for example, these constants (because they are preprocessor constants) can't be used with Fresh IDE code completion, cross reference, and all code exploration tools.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 13 Dec 2012, 06:00
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
mrpink



Joined: 03 Jun 2005
Posts: 27
Location: Germany
mrpink 13 Dec 2012, 23:43
Now, is that my bad coding style or a weakness of Fresh IDE?
Anyway, shouldn't be a problem to do a search and replace for all fixes and equs Wink
Hope to see my code in one of your projects though Very Happy
Post 13 Dec 2012, 23:43
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3  Next

< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.