Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.rst

(R)regular Expression H(unt)

Dead-easy regular expression matching in C#:

csharp> using TheLimberLambda.Util;
csharp> "The quick, brown fox ...".Runt(@"\w+");
{ "The", "quick", "brown", "fox" }

Return matches within enumerables of String and include the 1-based line number:

csharp> using TheLimberLambda.Util;
csharp> // 1-based line number
      > new[] {
      > @"Looking for a ",
      > @"G]Z('*br8<[~vo3I`W{T",
      > @"#U'Deb?7D^3O&~93ni>y",
      > @"{VAfo8yo9/Fqs7#ezpVK",
      > @"gneedleiinQm}W4l4%7|",
      > @">=?a&*p~r!?vv'[bDjmd",
      > @"58~D*S0P)i-._o|u)U?e",
      > @"WR`AjezlL*5VGS`Wt<'x",
      > @"W%!%re2BNN4w7fAt\H$5",
      > @"!?fjm!ET;X)nbfRd)*7'",
      > @"7*[vF!fzN:kk_7wLMSI4",
      > @"a haystack" }.
      > Runt(@"(?:nee\w+e|in(?![a-z]))");
{ 5: needle, in }

Search in text files, and return the line number:

csharp> using TheLimberLambda.Util;
csharp> using System.IO;
csharp>
csharp> File.WriteAllText("/tmp/julius.txt",
      > @"veni
      > vidi
      > vici
      > ");
csharp> new FileInfo("/tmp/julius.txt").Runt("i[a-z]i");
{ 2: idi, 3: ici }

About

Dead-easy regular expression matching for C#

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.