))+(?=)' ) , isQueryOfQuery = new cfregex( '(?si)(?<=\s)dbtype\s*=\s*(["'']?)query\1' ) , killParams = new cfregex( '(?si)]++>' ) , killCfTag = new cfregex( '(?si)]*+>' ) , killOrderBy = new cfregex( '(?si)\bORDER BY\b.*?$' ) , killBuiltIn = new cfregex( '(?si)##(#ListChangeDelims(This.BuiltInFunctions,'|')#)\([^)]*\)##' ) , killEscapedHash = new cfregex ('(?:##{2})++') , findScopes = new cfregex( '(?si)(?<=##([a-z]{1,20}\()?)[^\(##<]+?(?=\.[^##<]+?##)' ) , findQueryName = new cfregex( '(?<=\bname\s{0,99}=\s{0,99})(?:"[^"]++"|''[^'']++''|[^"''\s]++)' ) , Newline = new cfregex( chr(10) ) }/> (?x) ## Segment names must be preceeded by newline or paren. ## This helps avoid strings/variables causing confusion. (?<= (?:^|[()\n]) \s{0,99} ) #SegKeywords#[\s(] ## This part needs to lazily consume content until it finds ## the next segment, whilst also making sure it's not ## dealing with a [bracketed] column name. ## ## For performance, splitting out whitespace and parens ## allows the negative charset to match possessively ## without breaking the overall laziness. (?: [^\[\s()]++ | [\s()]+ | \[(?!\s*#SegKeywords#\s*\]) )+? ## A segment must be ended by either end of string or ## another segment. (?= $ | (?<=[)\s])#SegKeywords#[\s(] ) ' ) /> ' ) />