.Net Regex to parse Excel header / footer strings -


I am trying to create a .NET Regex which will separate the Excel header data string in its component parts. The following example shows the format of the raw data string I needed to parse:

  & amp; LLeft-side text & amp; CCenter text and RRight-side text  

Tags & amp; L, & amp; C & amp; R uses the left, center and right sections of header data respectively. Therefore, I need a regigax which will separate the above string into several sub-strings, each of which is & amp; L, & amp; C & amp; R will start with

Notes: Left, center, right square can be zero or more times in a header (where many opportunities for a given section will be added to the client code). The ampersand escape character is also used for formatting in each section, so reggax should use more than the above mentioned margin.

Thank you, in advance, for your suggestions.

((? & Lt; = & amp; nbsp;) (? [\ W \ W] +?) (? ((& Amp; c | Amp; R | $))))

This will match the text between A & L and C & L & R. (If & amp; c does not exist) or & amp; L and end (if & amp; si & amp; nbsp; does not exist), called in a designated match, LeftText gives you the A & For A & amp; By changing l and from the end section & amp; By removing c, and doing the same for the right section. It could be or maybe what you want, it is difficult to say this from a simple example given. The central part [\ w \ W] may need to be covered with loud because it can catch too much, but it works for example given.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -