Return to Snippet

Revision: 2231
at January 18, 2007 13:59 by rengber


Updated Code
\S*\s*(?=\=\s*\S*\s*new\s)

Revision: 2230
at January 18, 2007 12:30 by rengber


Initial Code
\S* \s* (?=\=\s*new\s)

Initial URL

                                

Initial Description
This expression grabs the token preceding the = sign which precedes the keyword new.   The expression within the parenthesis is a positive lookahead which matches an equal sign followed by zero or more spaces, then zero or more characters (for example an explicit cast) followed again by zero or more spaces, finally the keyword new, and at least one space.

Initial Title
Regular Expression to Grab an Object Reference Name from a C# Code File.

Initial Tags

                                

Initial Language
Regular Expression