Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Can I do this with a Regular Expression?

$
0
0

I am using  System.Text.RegularExpressions.  I'm looking for a regular expression that will match the end of a document. These documents end with a string on its own line that looks like:

PAGE 1 of 1

PAGE 2 of 2

PAGE 3 of 3

...

I don't want the expression to match "PAGE 1 of 3" or other strings where the two numbers don't match.  I realize that I can just recognize the string and then use an outside method to evaluate the two numbers inside and determine if I want to use that match. @"(?<=PAGE\x20\d*of\x20\d*") - I'm using a look behind because I'm splitting the document after the match. 

Is there a way just using regular expressions to do this? 


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>