Attract-Mode Support Forum

Attract-Mode Support => Scripting => Topic started by: DietCoke on March 12, 2015, 09:30:18 PM

Title: Filters documentation?
Post by: DietCoke on March 12, 2015, 09:30:18 PM
I've come across some info here:

https://github.com/mickelson/attract/wiki/Example-filters

Is there any other resource for filter information?  I'd like to build some but more info out there would be great.  I generally just slash my way through code, bastardize it and then criticize it :) 
Title: Re: Filters documentation?
Post by: liquid8d on March 12, 2015, 11:31:28 PM
Cools had a couple examples as well:

http://forum.arcadecontrols.com/index.php/topic,135704.msg1416194.html#msg1416194

Is there something you don't understand, or just wanting more examples?
Title: Re: Filters documentation?
Post by: DietCoke on March 13, 2015, 09:45:59 AM
Thanks Liquid for the link!

This is luckily one of the items that I'm actually looking to figure out vs. chasing something I've misconfigured!  Documentation / organized chaos like this, perhaps?

https://www.autoitscript.com/autoit3/docs/functions.htm

Luckily it doesn't look like filtering is as complex as hacking apart Autoit code!
Title: Re: Filters documentation?
Post by: raygun on March 30, 2015, 10:52:52 PM
Filters are simply doing pattern matching using the squirrel library's regular expressions (bugs and all).  So the squirrel documentation, particularly this: http://www.squirrel-lang.org/doc/sqstdlib3.html#d0e2183 will be of some help too.



\   Quote the next metacharacter
^   Match the beginning of the string
.   Match any character
$   Match the end of the string
|   Alternation
(subexp)   Grouping (creates a capture)
(?:subexp)   No Capture Grouping (no capture)
[]   Character class

GREEDY CLOSURES.

*   Match 0 or more times
+   Match 1 or more times
?   Match 1 or 0 times
{n}   Match exactly n times
{n,}   Match at least n times
{n,m}   Match at least n but not more than m times
ESCAPE CHARACTERS.

\t   tab (HT, TAB)
\n   newline (LF, NL)
\r   return (CR)
\f   form feed (FF)

PREDEFINED CLASSES.

\l   lowercase next char
\u   uppercase next char
\a   letters
\A   non letters
\w   alphanumeric [_0-9a-zA-Z]
\W   non alphanumeric [^_0-9a-zA-Z]
\s   space
\S   non space
\d   digits
\D   non nondigits
\x   exadecimal digits
\X   non exadecimal digits
\c   control charactrs
\C   non control charactrs
\p   punctation
\P   non punctation
\b   word boundary
\B   non word boundary