Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


Finding First line in the text using regular expressions with .net


Finding First line in the text using regular expressions with .net

In this regular expressions, we are going to find first line in the text.

Regular Expression Pattern

\A.*

A description of the regular expression:

Beginning of string
Any character, any number of repetitions

How It Works

This regular expression will check for Beginning of line followed by Any character.


Read the rest of this entry »

Finding each line in the text using regular expressions with .net


Finding each line in the text using regular expressions with .net

In this regular expressions, we are going to find each line in the text.

Regular Expression Pattern

^.*$

A description of the regular expression:

Beginning of line or string
Any character, any number of repetitions
End of line or strin

Sucessful Matches

This is a test.
What you want?
That’s great!
as shown below:


Read the rest of this entry »

Finding Sentence using regular expressions with .net


Finding Sentence using regular expressions with .net

In the field of linguistics, a sentence —an expression in natural language— is often defined to indicate a grammatical and lexical unit consisting of one or more words that represent distinct concepts. A sentence can include words grouped meaningfully to express a statement, question, exclamation, request or command.

All the sentences contins group of words ending with .(punctuation mark), ?(question mark), !(exclamation mark) or : (colon) etc. In this regular expression we are going to find out sentences, means group of words ending with .(punctuation mark), ?(question mark), !(exclamation mark) or : (colon) etc.

Regular Expression Pattern

(?sx-m)[^\r\n].*?(?:(?:\.|\?|!|\:)\s)

A description of the regular expression:

Change options within the enclosing group [sx-m]
Turn OFF Multiline option
Turn ON Single Line option
Turn ON Ignore Pattern Whitespace option
Any character that is NOT in this class: [\r\n]
Any character, any number of repetitions, as few as possible
Match expression but don’t capture it. [(?:\.|\?|!|\:)\s]
(?:\.|\?|!|\:)\s
Match expression but don’t capture it. [\.|\?|!|\:]
Select from 4 alternatives
Literal .
Literal ?
!
Literal :
Whitespace


Read the rest of this entry »

How many types of exception handlers are there in .NET ?


The exception information table represents four types of exception handlers for protected blocks:

  • A finally handler that executes whenever the block exits, whether that occurs by normal control flow or by an unhandled exception.
  • A fault handler that must execute if an exception occurs, but does not execute on completion of normal control flow.
  • A type-filtered handler that handles any exception of a specified class or any of its derived classes.
  • A user-filtered handler that runs user-specified code to determine whether the exception should be handled by the associated handler or should be passed to the next protected block.

How the Runtime Manages Exceptions ?


The runtime uses an exception handling model based on exception objects and protected blocks of code. An Exception object is created to represent an exception when it occurs.

The runtime creates an exception information table for each executable. Each method of the executable has an associated array of exception handling information (which can be empty) in the exception information table. Each entry in the array describes a protected block of code, any exception filters associated with that code, and any exception handlers (catch statements). This exception table is extremely efficient and there is no performance penalty in processor time or in memory use when an exception does not occur. You use resources only when an exception occurs.