Jump to content

Finding a specific pattern of numbers in body content


n1concepts
Go to solution Solved by .josh,

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.