[svlug] Lex question about variable length fields

Jesse Monroy jesse650 at gmail.com
Thu May 22 16:54:25 PDT 2014


Robert,
your answer is not helpful.

Bob,
here are some notes on Regular Expression

http://bsdmasterindex.com/talks/

Jesse
 On 05/22/14 15:33, Bob Smith wrote:
> I would like to get three single word tokens followed by a fourth
> token that is whatever is left on the input line.  So, the input
> line "My name is Jabba the Hutt" would return tokens
> "My",
> "name",
> "is", and
> "Jabba the Hutt".
>
> The last token looks like several words and when I write the lex
> rules to pick up more than one word, it picks up the whole line.

I think most parsers tokenize the whole line, then piece back together.
This is why, without quoting, multiple spaces are condensed into one.

$ echo this      has    a  lot   of  spaces
this has a lot of spaces

--
Mr. Flibble
King of the Potato People
http://www.linkedin.com/in/RobertLanning

_______________________________________________
svlug mailing list
svlug at lists.svlug.org
http://lists.svlug.org/lists/listinfo/svlug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.svlug.org/archives/svlug/attachments/20140522/8b264b9d/attachment.htm


More information about the svlug mailing list