Jump to content

Finding a specific pattern of numbers in body content


n1concepts

Recommended Posts

Hi,

 

I've always struggled w/RegX and need some guidance on how best to parse an xml file that will contain a series of (four) numbers between 1 thru 99 for each column. Note: some of the entries will contain spaces while other will not - see (below) examples:

<body>
<p>There may be several lines of text prior to the row of numbers we need to capture 
is presented in later sentences/paragraphs</p>

<p>Here is 1st example of numbers we need to capture: 1 - 41 - 16 - 99</p>
<p>In this 2nd example, the file may send the numbers:  1-41-16-99</p>

<p>Could be alot more text to follow after that set of numbers but will only be one set 
of the numbers in the file (never multiple).
</body>

So I got to figure out an expression/function that will:

 

1. exclude all the other content and just grab (to later echo in script or save to MySQL db) as such: 1-41-16-99

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.