Posts Tagged ‘Regex’

My friend, Mr. Steve Good, approached me about a problem he was having where he needed to add a namespace to an HTML tag at runtime. Essentially he was parsing some dynamic HTML and wished to inject an additional namespace into the HTML declaration. Regular expressions to the rescue! The first test I ran was [...]

A question was posted on the Dallas/Ft. Worth ColdFusion User Group today. I’m trying to parse a text file to find a particular string, then extract that string and approximately 100 characters past that. So I’ve cooked up a little code sample that uses the Java regular expressions classes. The ColdFusion regular expression methods are [...]

SQL Formatted Revisited

Posted: 8th April 2009 by Adam Presley in Development, Regex
Tags: ,

I posted an entry yesterday about using a regular expression to reformat SQL queries in code. After a bit more exploring and playing around in RegexBuddy (wonderful tool) I came up with a better regular expression to do the job. This version accounts for the last column much better than the previous expression I tried. [...]

If you’ve worked with a lot of inline SQL like I have over the years you’ve probably discovered quickly that as you have to add more columns to your query, especially columns that are only added on a dynamic condition, it can be easy to mangle up your commas. Here’s an example of a common [...]