Hacker News new | past | comments | ask | show | jobs | submit login

Potentially cool if you want to generate regular expressions dynamically at runtime



So, string concatination?


Indeed! In fact, the library author cites this as one of the "main advantages" of their library (under "Getting Started"):

> As you can see one of main advantages of using this library is ability to document every line of code without any hassle.

In other words, the 'x' flag. Though it turns out JavaScript doesn't provide the x flag, but it's the same thing as string concatenating a regex across different lines.

The fact that the author includes the warning "Never-ever add a semicolon if you want to continue expression" on a method chain shows the level of sophistication this library is intended for.


Actually, I think this library could provide a security benefit since generating code by string concatenation is generally dagnerous. Analogous to generating HTML or SQL -- safer to use a library than to construct it yourself.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: