Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Req: Regular expression support in CityScript

I am a new user, evaluating CityDesk.  I have server-side scripts in place to scan a bunch of files and build a dynamic menu.  I was looking at CityScript and I can do it using a keyword field.  What would really be nice is if I could use perl-style regular expressions for the various conditions, like file or folder name.

Something like:

{$ foreach x in (filename "/art[0-5]fo?o/") SortDescendBy .fileddate $}

Dennis Roberts
Monday, June 17, 2002

I would like regexp too. Other solutions are possible today. without regexp. See my suggestion for client side javascript dynamic menu's. You can do the same on the server side (server side javascript, php, perl although with some overhead.

Adriaan van den Brand
Tuesday, June 18, 2002

Why not use keywords:

{$ foreach x in (keyword_contains "art") SortDescendBy .fileddate $}

My site is mostly driven by "or" statements like:

(or (folder "music") (keyword_contains "music") )

Wednesday, June 19, 2002

That is what I am doing now, using the keyword field.  I just want perl-style regular expressions.  It is a lot more flexible.

Dennis Roberts
Wednesday, June 19, 2002

On a completely unrelated topic, the perl regex engine is being completely revamped.

I remember the folks at Fog wanted to prevent accidental infinite recursion in their scripting. Reg Ex, while extremely handy, makes infinite recursion that much easier to create, and that much more difficult to prevent.

Then again, they're shelving CityScript in favor of... what was it, vbscript? for the next version. MUCH more robust than CityScript. Hopefully you either (a) will have RegEx, or (b) won't need it.

Thursday, June 20, 2002

VBScript includes regular expressions

Joel Goldstick
Thursday, June 20, 2002

Much as I hate to talk about unimplemented features :/

We're thinking of using JavaScript, not VBScript, for two reasons:

* same language as most people use for client-side scripts
* there are at least two free implementations I know of, so we can choose the less-buggy one at any given time.

Joel Spolsky
Friday, June 21, 2002


Tuesday, June 25, 2002

*  Recent Topics

*  Fog Creek Home