by dotnetpete
3. May 2011 16:17
There is nothing regular about regexs. Awesome expressions doesn't roll of the tongue as nicely but it's what they are.
Some cool uses I have found:
- Swap variable assignment direction i.e. a=b => b=a.
- Generation of class property code from a list of column names.
Today I had an Excel sheet with two columns that I needed to import into a QL database. On each row the values were tab separated. I was able to use "\(.+\)\t\(.+\)" in my find expression and "insert into temp values(\1,'\2')" in my replace expression to do the job.
They are complex to master and get crazy very quickly - regex for validating email addresses - but they are well worth the effort.
f5f0f6b7-4ac4-4e43-bfe5-b6ef5c7a5b7b|0|.0
Tags: