Re: Regex help
From: Bob Dankert (bob_at_nospamnvsn-it.com)
Date: 05/07/04
- Next message: Nicholas Paldino [.NET/C# MVP]: "Re: Using a command to open the Device Manager"
- Previous message: Jimbo: "Re: dates - subtract 12 months"
- In reply to: Jeffrey Tan[MSFT]: "Re: Regex help"
- Next in thread: Jeffrey Tan[MSFT]: "Re: Regex help"
- Reply: Jeffrey Tan[MSFT]: "Re: Regex help"
- Messages sorted by: [ date ] [ thread ]
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.
>
- Next message: Nicholas Paldino [.NET/C# MVP]: "Re: Using a command to open the Device Manager"
- Previous message: Jimbo: "Re: dates - subtract 12 months"
- In reply to: Jeffrey Tan[MSFT]: "Re: Regex help"
- Next in thread: Jeffrey Tan[MSFT]: "Re: Regex help"
- Reply: Jeffrey Tan[MSFT]: "Re: Regex help"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|