Click here to Skip to main content
15,887,027 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
QuestionRegex in DataAnnotations that can unmatch a input string containing not paired double quote " Pin
stevecwlee28-Feb-11 16:31
stevecwlee28-Feb-11 16:31 
AnswerRe: Regex in DataAnnotations that can unmatch a input string containing not paired double quote " Pin
Captain Ketchup4-Apr-11 1:40
Captain Ketchup4-Apr-11 1:40 
Questionxml regex (for php) Pin
fdsfsa76f7sa611-Nov-10 9:12
fdsfsa76f7sa611-Nov-10 9:12 
AnswerRe: xml regex (for php) Pin
AspDotNetDev11-Nov-10 10:28
protectorAspDotNetDev11-Nov-10 10:28 
GeneralRe: xml regex (for php) Pin
fdsfsa76f7sa611-Nov-10 11:08
fdsfsa76f7sa611-Nov-10 11:08 
QuestionExpression needed Pin
Mazdak5-Sep-10 16:22
Mazdak5-Sep-10 16:22 
AnswerCross-post Pin
Luc Pattyn5-Sep-10 16:54
sitebuilderLuc Pattyn5-Sep-10 16:54 
AnswerRe: Expression needed Pin
OriginalGriff6-Sep-10 1:27
mveOriginalGriff6-Sep-10 1:27 
It's not the best in the world, but it does the job:
//  using System.Text.RegularExpressions;

/// <summary>
///  Regular expression built for C# on: Mon, Sep 6, 2010, 12:26:15 PM
///  Using Expresso Version: 3.0.3634, http://www.ultrapico.com
///  
///  A description of the regular expression:
///  
///  <%
///      <%
///  Any character that is NOT in this class: [\"], any number of repetitions
///  "
///  [InQuotes]: A named capture group. [.*]
///      Any character, any number of repetitions
///  Match a suffix but exclude it from the capture. [\"]
///      Literal "
///  Any character that is NOT in this class: [%], any number of repetitions
///  %>
///      %>
///  
///
/// </summary>
public static Regex regex = new Regex(
      "<%[^\\\"]*\"(?<InQuotes>.*)(?=\\\")[^%]*%>",
    RegexOptions.IgnoreCase
    | RegexOptions.CultureInvariant
    | RegexOptions.IgnorePatternWhitespace
    | RegexOptions.Compiled
    );


// This is the replacement string
public static string regexReplace = 
      "<Hello>";


//// Replace the matched text in the InputText using the replacement pattern
// string result = regex.Replace(InputText,regexReplace);

//// Split the InputText wherever the regex matches
// string[] results = regex.Split(InputText);

//// Capture the first Match, if any, in the InputText
// Match m = regex.Match(InputText);

//// Capture all Matches in the InputText
// MatchCollection ms = regex.Matches(InputText);

//// Test to see if there is a match in the InputText
// bool IsMatch = regex.IsMatch(InputText);

//// Get the names of all the named and numbered capture groups
// string[] GroupNames = regex.GetGroupNames();

//// Get the numbers of all the named and numbered capture groups
// int[] GroupNumbers = regex.GetGroupNumbers();

Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Questionhtml tag finder Pin
moein.serpico14-Aug-10 23:14
moein.serpico14-Aug-10 23:14 
AnswerRe: html tag finder Pin
PIEBALDconsult15-Aug-10 8:19
mvePIEBALDconsult15-Aug-10 8:19 
AnswerRe: html tag finder Pin
OriginalGriff15-Aug-10 8:31
mveOriginalGriff15-Aug-10 8:31 
GeneralRe: html tag finder Pin
AspDotNetDev26-Sep-10 9:29
protectorAspDotNetDev26-Sep-10 9:29 
AnswerRe: html tag finder Pin
AspDotNetDev26-Sep-10 9:28
protectorAspDotNetDev26-Sep-10 9:28 
AnswerRe: html tag finder Pin
Hiren solanki17-Dec-10 0:40
Hiren solanki17-Dec-10 0:40 
QuestionDifferences between matches with same RegEx [modified] Pin
RichardGrimmer6-Aug-10 0:00
RichardGrimmer6-Aug-10 0:00 
AnswerRe: Differences between matches with same RegEx PinPopular
Peter_in_27806-Aug-10 2:22
professionalPeter_in_27806-Aug-10 2:22 
GeneralRe: Differences between matches with same RegEx - RESOLVED Pin
RichardGrimmer8-Aug-10 22:53
RichardGrimmer8-Aug-10 22:53 
QuestionEven Expresso couldn't help me with this RegEx - Can You? Pin
Sonhospa30-Jul-10 7:19
Sonhospa30-Jul-10 7:19 
AnswerRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
Luc Pattyn30-Jul-10 7:57
sitebuilderLuc Pattyn30-Jul-10 7:57 
NewsPartially resolved: Even Expresso couldn't help me with this RegEx - Can You? Pin
Sonhospa31-Jul-10 1:06
Sonhospa31-Jul-10 1:06 
GeneralRe: Partially resolved: Even Expresso couldn't help me with this RegEx - Can You? Pin
Luc Pattyn31-Jul-10 2:24
sitebuilderLuc Pattyn31-Jul-10 2:24 
AnswerRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
PIEBALDconsult12-Aug-10 18:07
mvePIEBALDconsult12-Aug-10 18:07 
AnswerRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
Luc Pattyn12-Aug-10 18:20
sitebuilderLuc Pattyn12-Aug-10 18:20 
GeneralRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
PIEBALDconsult12-Aug-10 18:23
mvePIEBALDconsult12-Aug-10 18:23 
GeneralRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
AspDotNetDev23-Aug-10 12:37
protectorAspDotNetDev23-Aug-10 12:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.