.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How do I prevent the sentence-matching regex ([^.?!]+[.?!]) from matching .?! followed by quotes?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :WPF

Hello All,


Is there a way of preventing this from matching  .?! that are inside of (followed by) quotations?

For example:

He tossed back his veil, and Gork looked into the features he had seen depicted on the silver coin. "Aye, dog!" The voice was like the hiss of a giant snake.

matches as this (each match on a line of its own):

He tossed back his veil, and Gork looked into the features he had seen depicted on the silver coin.
"Aye, dog!
" The voice was like the hiss of a giant snake.

I'd like it to match as:

He tossed back his veil, and Gork looked into the features he had seen depicted on the silver coin.
"Aye, dog!" The voice was like the hiss of a giant snake.

View Complete Post

More Related Resource Links

Help with RegEx Match, matching after the first occurance

I can't seem to get the regex I need for this match. I have an html document that has multiple <DIV id="Emag_Header"> tags in it. It's an html render of a magazine article from a web page. What I need to do it get all html including the first occurance of the div. I then need all html up to the next occurance of the div. I then want to omit the div but get any html after that. All the time omitting the div (after the first one which needs to be in there). I tried a capture/replace method like this:

regex = @"(<DIV[\s?]+Id=""Emag_Header"">.*?</DIV>.*)<DIV[\s?]+Id=""Emag_Header"">.*?</DIV>(.*)";
 content = reg.Replace(content, "$1$2");

 The idea was to grab the first occurance and all html up to the second occurance, then grab all the html after that. Of course it works fine for the first two occurances, but the .* at the end matches everything (as its supposed to), and a 3rd occurance of the div will be in there....

Can anyone help me get this:

Is this load full or matching one only... coz of need to know performance



This my Two Table i have one doubt...

For my first table i have select Top 2 from Employee_info 

and second table itz just selct * from MDEp..

What my doubt is on loading the above report?

Is this load all the record from MDep or just matching one based on Employee_info..?

The Polyglot Programmer: Mixing And Matching Languages


See why you need to be a polyglot programmer and what mixing and matching languages can do for your projects.

Ted Neward

MSDN Magazine March 2009

SQL Server 2005: Regular Expressions Make Pattern Matching And Data Extraction Easier


Now you can perform efficient, sophisticated text analysis using regular expressions in SQL Server 2005.

David Banister

MSDN Magazine February 2007

No Results matching your search were found. WSS 3.0


I've got one sharepoint 3.0 site, which is a hostNamedSiteCollection which won't return any results when we search it - searching the entire site or a single list both produce the same "no results matching your search were found".
The site uses Windows Authentication.  We have no Alternate Access Mappings set up. It is regular HTTP
I've added test content to other sites housed in the same Web Application and searched - that new data is appearing in the results.
I did a backup using STSADM and restored the site to my dev server (as both a hostNamedSiteCollection & a regular site collection) - searches return results just fine.
I deleted the site from the prod server and restored it (into a different content database even!) from a backup  I made with STSADM - no results are returned.
I restored the site to the same web application as a Standard site (http://webapp/sites/sitename) (NOT a host named site collection) and results ARE returned.

I've looked at the trace logs & application logs on the server, but can't find any errors that I can tell might be related..

This is the only site I've ever seen have this problem.  We have plenty of other hostNamedSiteCollections and search is working fine on them.


Matching set of characters via regular expression

I need to be able to match sets of quote and space characters in a string and replace these accordingly. I currently have this done in 2 lines of code, but would like to use regular expression so that I can use only 1 line of code. See below: var Qt = unescape("%22"); //quote char var Sp = unescape("%20"); //space var Cr = unescape("%0d"); //carriage return var Lf = unescape("%0a"); //line feed var CrLf = Cr + Lf;  //carriage return & line feed stringOut = stringIn.replace(Qt+Qt+Sp+Qt,Qt+Qt+CrLf+Qt); stringOut = stringOut.replace(Qt+Qt+Sp+Qt+Qt,Qt+Qt+CrLf+Qt+Qt);   I want to replace space in string like in pattern below with carriage return line feed: (in hex) 22 22 20 22 or 22 22 20 22 22. This needs to return 22 22 0D 0A 22 or 22 22 0D 0A 22 22   Line in green above will only match and replace 22 22 20 22 , but I want have regular expression into 1 line of code which  will match and replace either 22 22 20 22 or 22 22 20 22 22  

I need a regex for the following sentence

I have a line of text which is as follows  : This should occur before variable1 = 1 variable2 =2 variable3=6 variable4=9   I want a regex which checks if this text (This should occur before ) comes before  the string of the variables (variable1, variable2, variable3, variable4 ) and also  should pass if the placement of the variables can occur anywhere in the sentence.Also the regex should pass only if the variable4 has a value greater than 9.  

SELECT statement to return NULL by matching data from another table.

Hi,I am fairly new at SQL and I have been struggling for days now trying to find an answer to my problem and i have come to the point where i have run out of ideas and about to give up. I'm hoping someone can put me in the correct path. The problem I have 3 table Table 1 Department" has the following columns: REF, NAME Table 2  "Department_Collection" has the following columns: REF, DEPARTMENT_REF, MANAGER_REF, STORE_REF, ACTIVE Table 3 Store" has the following columns: REF, NAME, STORE_ID  What i am trying to do is to take all the rows in the Department table and get a matching row (DEPARTMENT.NAME, DEPARTMENT_COLLECTION.REF) from the Department_Collection table, if it does not match any then still display DEPARTMENT.NAME but mark DEPARTMENT_COLLECTION.REF as null. I have tried the following select statement but it seem to remove all null values when supplied with a 'storename' SELECT DEPARTMENT.NAME, DEPARTMENT_COLLECTION.REF FROM DEPARTMENT_COLLECTION right outer join DEPARTMENT on DEPARTMENT_COLLECTION.DEPARTMENT_REF = DEPARTMENT.REF left outer join STORE on DEPARTMENT_COLLECTION.STORE_REF = STORE.REF where STORE.NAME = 'storename' order by DEPARTMENT.NAME   Any help will be greatly appreciated. Thanks

Inline Editing No Matching Records - No Insert

Hello.  I have been using Inline editing in Sharepoint Designer 2010.  Is it possible to have the insert link displayed even when there are no matching records?  The Default view shows edit, delete, and insert links.  But, the No-Matching Records template doesn't.  I think I can use Newform.aspx for the first record instead, but would like it to operate the same way for inserts as it does when there are records.  Thanks

Limiting Nickname / Phonetic matching to just First Name

The Nickname / Phonetic matching in SharePoint 2010 is a nice new feature, where searching for Jeff will pull up results for Geoff, Jeffrey, etc. However, it also searches surnames and pulls in people with a last name like Jefferson, Jeffery, Jeffrey When creating your query, is there any way to limit the nickname searching to just the forename? If I do a queries like "FirstName:Jeff" or "FirstName=Jeff", then it stops doing nickname/phonetic matching. I've also tried "Nickname:Jeff" and "FirstNamePhonetic:Jeff", but these do not pull up any results at all. How does the nickname/phonetic matching work internally, does it search over a number of internal field names (if so, can these be searched using the advanced property search such as FirstName:Jeff). I thought perhaps I could get the kind of search we need by combining it with logical operators, so if I want any person with a first name sounding like Jeff, and surname beginning with B, then I could do this...   LastName:B* (FirstName:Jeff* OR Jeff) ...but the Jeff on it's own without a Property name Prefix causes a Malformed Query error, I assume it cannot be applied with Logical Operators. Changing the query to...   LastName:B* FirstName:Jeff* Jeff ...brings results, but the wrong results we want as the query does not pull back people with a Forename of Geoff, presumably

Wild Card Best Bet Matching

Is there a way to use wildcards in the keywords used in the Best Bets configuration?

Percentage of matching days off among employee's

Hi All,i have Intime and Outtime of each employee for all the days of 1st,2,3,4 week.There will be a off for 1 day or 2 days for each employees.Based on this i need to calculate consisitency days off assignmanet i.e no of matching days off among employees in percentage.If there are 100 emplyees out of 100 employees 50 people may get week off on the same day(for example sunday). I want result in percentage.result like thisConsistency Days of assignment            Across 4 weeks            3 weeks                2weeks                0                                                             2%                                   0%     &

Simple Regex. Select 2 strings in a sentence

Hello,  I am a begginer in Regular expressions. I am trying to write a regex to print out a specific string in a sentence.  For example:  "We've found questions similar to yours" I would like to create a regex for the word "found" and "yours". whenever found is matched OR yours is matched print the word.  Basically i just need to know how the OR statement works in this case.  regex.match("found" OR "yours")  ??? Thank you -Klevis

Call specific web service method by matching string value to method name?

I am getting a value in string format.  Then, I call a web service and try to dynamically call the method that corresponds to the string's value.  It doesn't work.  Any ideas?              Dim methodname As String = "getquotes"                 Dim track As localhost.Tracker = New localhost.Tracker()                 'the below line is where it fails                 track.methodname(parameter)               

LIKE Condition - Single Percentage Sign Matching?


What is the expected behavior when a LIKE condition specifies a single percentage sign? For example, if I have a Customer table with a CustomerName field and I write the following SQL Query:

SELECT * FROM Customer WHERE CustomerName LIKE '%'

  1. Does the single percentage sign negate the LIKE condition?
  2. Would this specific statement be equal to just SELECT * FROM Customer?
  3. Finally, does this work with all data types, or just char/nchar/varchar/nvarchar?



I have two tables, and i want to return all records where both fields match for example below is a sample table

Query Plan handle is not matching in the query related system DMV's


Ent : SQL Server 2008 SP17

OS  : Windows Server 2008 Ent.Edt

While troubleshooting a performance issue for a Query (SP) I came across this weired thing that the Query Plan handle is not matching across all the Query related system DMV’s.


Senario with a simple query

For each executing Query a plan handle is generated in sys.dm_exec_connections (Column most_recent_sql_handle).Based on the sql_handle the q

name Disp settext
A and E Bank Issue
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend