Re: Regex help

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bob Dankert (bob_at_nospamnvsn-it.com)
Date: 05/07/04


Date: Fri, 7 May 2004 08:12:38 -0500

Thanks a lot Jeffrey!

This worked to resolve the problem. I guess without much regular expression
experience comes the problem that I do not necessarily know when it is time
to use regular expressions and when it is not time. I appreciate the help
from everyone!

Thanks,

Bob Dankert
""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message
news:AXfbir$MEHA.2756@cpmsftngxa10.phx.gbl...
> Hi Bob ,
>
> Thanks for your feedback.
>
> Oh, yes, because your quote is not stay together with newline, so I think
> Mike's suggestion does not meet your need.
>
> For your issue, I think this is not regex problem, what you need is a good
> algorithm to parse your string.
> After some thinking, I may find one algorithm for you. Maybe it is not the
> best one, but it should work for you:
>
> First, you may split the input string into a string array with "\n"
>
> Then, you should loop through each short string array to count each string
> array item's quotes number, the key point is to determine if the array's
> quote number is odd number or even number.
>
> At last, you may concatenate the string array through the rule below:
> 1. Once you find an array item has even number of quotes, just leave and
> jump it.
> 2. If it has odd number of quotes, mark it as start concatenate array
item,
> find next array item that has odd number of quotes. Then concatenate all
> the items between 2 items that have odd number quotes.
> 3. continue the above 2 steps.
>
> I hope I have explained this algorithm.
>
> =========================================
> Please apply my suggestion above and let me know if it helps resolve your
> problem.
>
> Thank you for your patience and cooperation. If you have any questions or
> concerns, please feel free to post it in the group. I am standing by to be
> of assistance.
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>



Relevant Pages

  • Re: Regex help
    ... you should loop through each short string array to count each string ... array item's quotes number, the key point is to determine if the array's ... If it has odd number of quotes, mark it as start concatenate array item, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: understanding arrays, and their use
    ... > path enclosed by double quotes, or several space separated words, ... > field, option1) and its value (4th field, string or boolean). ... understand how to access the other fields of the array that ... > "option1" (outside the array, which is tied to a widget), and I want to ...
    (comp.lang.tcl)
  • Re: Random Numbers
    ... I have a program that has character strings in an array, ... quotes to vary each time you start the program. ... method to accomplish this goal without user input? ... the conversion to integer will also happen automatically. ...
    (comp.lang.fortran)
  • Re: Foreach displaying data twice
    ... it should be in quotes. ... back to string, so it'll trigger some stupid notice.. ... The thing is, if you're calling a multidimensional array, you gotta use ... Thanks for setting me straight Rami! ...
    (comp.lang.php)
  • Re: Pointer-based arrays output strange
    ... news reader doesn't render. ... I'll assume these are quotes so you ... representation of an array in gfortran. ... is related to the construction of the dope vector in the internals of ...
    (comp.lang.fortran)