Tagged Questions
3
votes
0answers
175 views
Good Design For Regex, Capture Groups And Unit Testing
In a project I'm experimenting with using regular expressions to distinguish between various types of sentences and map them to functions to handle these sentences.
Most of these sentence handling ...
2
votes
0answers
93 views
Why does this regular expression not work
I am creating a FarPoint.Win.Spread.FpSpread at runtime and FarPoint.Win.Spread.CellType.RegularExpressionCellType at runtime.
The celltype will contain Regular Expression^\d{2,3}\:[0-5][0-9]$.
...
1
vote
0answers
60 views
Splitting a WHERE sql clause into array
I am trying to split a String which is the WHERE clause of a SQL statement into an array with 5 outputs where the following data is hold under each index:
0 - The initial clauses (WHERE/AND/OR) plus ...
1
vote
0answers
62 views
Correcting regex patterns across languages
I found this regex pattern at http://gskinner.com/RegExr/
,(?=(?:[^"]*"[^"]*")*(?![^"]*"))
Which is for pattern matching CSV delimited values (more specifically, the separating commas, which can be ...
1
vote
0answers
96 views
Effective way to search error handling bugs (regexes, parsers)
I'd like to search over thousands of files of c# code, for some evil places, where exceptions are possibly taken under the cover or at least not logged. I need regex expression which is able to find ...
1
vote
0answers
53 views
Replace non-decimal in KeyUp
Thanks to Joey in this question Remove non-digits, non-decimals, repeating decimals. I have a Regex.Replace, that looks like this
Regex.Replace(Txt, "[^-?\d+\.]|(?<=\.[^.]*)\.", "");
But now I ...
1
vote
0answers
42 views
RestRoute that allows periods in id and accepts result format
I have a heavily used REST service based on asp.net mvc. One of the resources is for users where you specify a given user with a route like this:
.../User/{id}.{format}
Ex:
...
0
votes
0answers
48 views
Regex for 404 “does not exist” exceptions - ELMAH / ASP.NET
I am using ELMAH to log exceptions that are caught during application execution.
On of the most frequent error messages is like so:
The file '/page/default.aspx' does not exist.
The file. ...
0
votes
0answers
95 views
Regex to parse a string and match a URL or folder path
I'm trying to change a regex that will match a url like http://www.google.com, and also allow it to match a folder name such as j:\Folder\Name\Here
I'm parsing the text of a message for any links ...
0
votes
0answers
87 views
Changing numbers with Replace
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ...
0
votes
0answers
82 views
Why is this regex inserting the tag?
I have the following function being called from the MSSQL CLR:
private static string ReplaceTags(string input, string TagsReplacementXML)
{
const string TagNamePattern = @"<\$\w+>";
...
0
votes
0answers
57 views
Regex matching sentenses
I want to be able to match sentence to a single result as an example
\w+
something
\w+ else
something \w+
so when i say "nothing" it will only list the first entry since that is a wildcard.
for ...
0
votes
0answers
110 views
Output value with System.Diagnostic.Debug.WriteLine()
I'm trying to find the value in this line of code:-
var import = match.Groups[1].Value;
in this method of my LessTransform.cs class
private static string ResolveImports(FileInfo file)
{
...
0
votes
0answers
184 views
Pass HTML checkbox in DataTable to HTML table
I am loading the rows of a DataTable from a list. Im trying to create an HTML checkbox in each row of the first column. Following loading of the DataTable (example provided in Portion 1), I convert ...
0
votes
0answers
106 views
Regex - Remove HTML Markup, without some of the tags
I have the following HTML markup:
<div class="someClass">
<h1>This is the title</h1>
<p>Some text</p>
<p>Some more text</p>
</div>
I need ...