Re: '^' and '$' in Regular expression

Chris F Clark <cfc@shell01.TheWorld.com>
Wed, 21 Apr 2010 18:30:18 -0400

          From comp.compilers

Related articles
'^' and '$' in Regular expression march1896@gmail.com (Tangel) (2010-04-21)
Re: '^' and '$' in Regular expression cfc@shell01.TheWorld.com (Chris F Clark) (2010-04-21)
Re: '^' and '$' in Regular expression march1896@gmail.com (Tangel) (2010-04-21)
Re: '^' and '$' in Regular expression mailings@jmksf.com (mailings@jmksf.com) (2010-04-22)
Re: '^' and '$' in Regular expression armelasselin@hotmail.com (Armel) (2010-04-22)
Re: '^' and '$' in Regular expression cfc@shell01.TheWorld.com (Chris F Clark) (2010-04-22)
Re: '^' and '$' in Regular expression quinn_jackson2004@yahoo.ca (Quinn Tyler Jackson) (2010-04-22)
Re: '^' and '$' in Regular expression cfc@shell01.TheWorld.com (Chris F Clark) (2010-04-22)
| List of all articles for this month |

From: Chris F Clark <cfc@shell01.TheWorld.com>
Newsgroups: comp.compilers
Date: Wed, 21 Apr 2010 18:30:18 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 10-04-052
Keywords: lex, DFA
Posted-Date: 21 Apr 2010 23:55:57 EDT

I hope this will not appear to be too rude, but your questiom makes me
curious as to why you are creating a new regular expression library
when you don't seem to grasp the fundamentals. What will your library
do that there isn't at least 1 other (and probably dozens of others)
doesn't already do?


If this were a homework assignment I could understand, you need to
learn, but it sounds like you are simply gratutiously reinventing
known technology and potentially creating an incompatible and likely
buggy version in the process.


Again, if you have an innovation, that's ok, but from your question
that sounds unlikely.


Finally, your idea of treating ^ and $ as \n and appending a \n to
both ends of the buffer is perfectly fine. It's not the only
solution, but it does have precedent. Why does it seem unsatisfactory
to you? If you can figure out what's wrong with your idea, it might
lead you to one of the alternate solutions. BTW, there is nothing
wrong with non-character labels (what you called weights and I believe
others have called guards, triggers, or conditions) on your edges, so
^ is a perfectly valid label on an edge, you machine just needs to
know what to do with it.


-Chris


******************************************************************************
Chris Clark email: christopher.f.clark@compiler-resources.com
Compiler Resources, Inc. Web Site: http://world.std.com/~compres
23 Bailey Rd voice: (508) 435-5016
Berlin, MA 01503 USA twitter: @intel_chris
------------------------------------------------------------------------------



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.