Browse by Tags

Tagged Content List
  • Blog Post: Unexpected effects of the RegEx SET operator [Greg]

    Regular Expressions (RegEx) are a powerful tool for searching for text that matches specific patterns, but it is also a complex tool that requires care and attention to detail. There are many caveats to using RegEx. Ron has recently published a few excellent blog posts on the .NET RegEx engine [ part...
  • Blog Post: Parsing Non-Standard Date and Time Formats [Ron Petrusha]

    Frequently, particularly when dealing with remote data collection devices, an application receives string data containing date and time information that must be converted to either DateTime or DateTimeOffset values. In these cases, the most commonly used parsing methods, the overloads of the DateTime...
  • Blog Post: .NET Regular Expressions: Regex and Balanced Matching [Ryan Byington]

    One of the questions that seems to come up a lot is that someone wants to match balanced parenthesis. Something like the string “(aa (bbb) (bbb) aa)” and they want to match from the beginning parenthesis to the matching end parenthesis. Generally this is not possible with regular expression, that language...
  • Blog Post: .NET Regular Expressions: how to use RegexOptions.IgnorePatternWhitspace [Ryan Byington]

    The IgnorePatternWhitespace option tells the Regex parser to ignore any spaces or tabs in your expression except if it is in a character class(ie [ ]). At first this may not seem all that useful but it really can increase the readability of a regular expression. Plus you can add comments to your expression...
  • Blog Post: New Format on the Block [Anthony Moore]

    One thing that has not changed much in Whidbey is the set of format strings used by base data types for parsing and formatting. However, there is one new format element supported by the DateTime class that can be very useful if you use the ParseExact method to parse XML. There is a new format element...
  • Blog Post: How to Work Around Problems Serializing DateTime in XML [Anthony Moore]

    I wrote a while ago about problems with the way DateTime worked with features like DataSet, XML Serialization (WebServices) and XmlConvert. Basically, DateTime is always treated as a local time by these XML-based systems, which means that you get incorrect results if you use UTC or whole dates with them...
  • Blog Post: Regex hangs with my expression [David Gutierrez]

    Well, actually, it doesn't hang. It just takes a really really long time, and you haven't waited long enough for it to finish. One of the pitfalls with regular expression is that you can write expressions which don't perform very well. In particular, you can end up with expressions whose search time...
  • Blog Post: DateTime Parsing and Formatting with Time Zones [Anthony Moore]

    Here is a new DateTim FAQ entry. What is the relationship between DateTime parsing and formatting and the time zone? Before reading below, see this entry for a more practical description of how to using formatting and parsing for the purposes of storing dates and times, which is where you are most likely...
  • Blog Post: Regular Expression performance [David Gutierrez]

    I often get questions about Regex and what the RegexOptions.Compiled flag actually does. There are in fact three different modes that Regex can work in: interpreted (without the compiled flag), compiled on the fly (with the compiled flag), and precompiled . Each of these modes has its own trade offs...
  • Blog Post: Kick Off the Blog with a TryParse sample!

    Well, I though I would kick off the BCL blog with a sample of TryParse. TryParse methods have been added to all the base datatypes in Whidbey (previously, TryParse was only available on the Double type). The TryParse demo is available on the new BCL website . The demo allows you to compare the speed...
Page 1 of 1 (10 items)