Ask HN: Should I used a lexer and parser for this?

https://news.ycombinator.com/item?id=2788091
by Trindaz • 15 years ago
4 2 15 years ago

A technical question I'm hoping some experienced hackers can help with:

My django application has a search feature for searching articles. It needs to handle logic features (AND, OR, (), etc.) and search articles accordingly using django's ORM tools and be used to create a regular expression that's used in my python code for certain searches that aren't performed at the database level. I've read about lexers such as ply - but I'd be interested to hear about anyone else who's had a similar problem. Take logic expressions, then transform them into something a database can use for searching, and then transform them into something else entirely for regex searches.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com