BCL Team Blog

Base types, Collections, Diagnostics, IO, RegEx...

parsing

Posts
  • BCL Team Blog

    Unexpected effects of the RegEx SET operator [Greg]

    • 0 Comments

    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.
    Here, I would like to briefly talk about a common caveat when using RegEx: the set operator [ ] and its effect on the contained tokens...

    ...
  • BCL Team Blog

    Parsing Non-Standard Date and Time Formats [Ron Petrusha]

    • 3 Comments

    The most commonly used methods for parsing textual data into  DateTime or DateTimeOffset values are different overloads of DateTime.Parse and DateTimeOffset.Parse. However, for many formats these methods throw a FormatException when they attempt to perform the conversion, and their corresponding TryParse overloads all return false. The .NET Framework provides two alternative method families: ParseExact and TryParseExact, that can be used to parse the string representations of date and time values. This article explores their usage.

    ...
  • BCL Team Blog

    .NET Regular Expressions: Regex and Balanced Matching [Ryan Byington]

    • 11 Comments
    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...
  • BCL Team Blog

    .NET Regular Expressions: how to use RegexOptions.IgnorePatternWhitspace [Ryan Byington]

    • 4 Comments
    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...
  • BCL Team Blog

    New Format on the Block [Anthony Moore]

    • 0 Comments
    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...
  • BCL Team Blog

    How to Work Around Problems Serializing DateTime in XML [Anthony Moore]

    • 8 Comments
    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...
  • BCL Team Blog

    Regex hangs with my expression [David Gutierrez]

    • 9 Comments
    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,...
  • BCL Team Blog

    DateTime Parsing and Formatting with Time Zones [Anthony Moore]

    • 3 Comments
    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...
  • BCL Team Blog

    Regular Expression performance [David Gutierrez]

    • 7 Comments
    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...
  • BCL Team Blog

    Kick Off the Blog with a TryParse sample!

    • 7 Comments
    Blog Kick-Off with a TryParse Sample...
Page 1 of 1 (10 items)