On Thu, Nov 18, 2010 at 1:42 PM, Jim mack <j...@less2do.com> wrote:
> I'm having trouble with !  Is there some combination of ![a-zA-Z0-9]+ that
> will match white-space or punctuation?

There's a few ways you can do it. You should be able to use
parenthesis to use '!':

alpha = [a-zA-Z0-9]
rule = (!(alpha) .)+

Note that '!' doesn't consume from the input stream. So here we say
the current character is not an alpha character and the '.' then says
consume any character. This 'any' character won't be an alpha due to
the '!' check before it.

Or you can use a semantic rule:

: some-factor-word ( char -- char )
  ...check for what you want here... ;

rule = . ?[ some-factor-word ]?

You can also explicitly look for the stuff you want:

rule = " " | "," | "\t" | "\n"

Chris.
-- 
http://www.bluishcoder.co.nz

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to