Re: how to split a string using ,fixed character length, variable text delimmiter
- From: garyusenet@xxxxxxxxx
- Date: 6 Dec 2006 06:33:48 -0800
This group is amazing. Thankyou both very much, i'm going to explore
them both now.
Oliver Sturm wrote:
Hello,
DODE86DODE86SZDO010144
So I guess what I am trying to do now is split the string, every time a
a string in encountered that is at least 20 characters long, is alpha
numeric, and has the first two letters repeated initself at least two
other times.
Yes, well... you could try using a regular expression such as this:
[ ]([A-Z][A-Z])([A-Z0-9]+)(\1)([A-Z0-9]+)(\1)([A-Z0-9]+)[ ]
(This could also be simplified a bit.)
This does evaluate the double repetition of the initial two characters,
but it can't check the maximum length of the string at the same time. If
you'd just be searching the text in question for occurrences of the
expression, you could easily write an additional check in code, to find
out whether any given string has the correct maximum length. But if you're
using this expression in a Split() call, you couldn't do that...
Personally I would probably still use an expression such as this, to
search for that is, and do the splitting myself. If you can't do the
splitting fully automatically, you'll have to do it yourself in any case -
and using a regular expression to do the delimiter searching seems a
better option to me than coding up the search in C#.
Oliver Sturm
--
http://www.sturmnet.org/blog
.
- Follow-Ups:
- References:
- how to split a string using ,fixed character length, variable text delimmiter
- From: garyusenet
- Re: how to split a string using ,fixed character length, variable text delimmiter
- From: Peter Bradley
- Re: how to split a string using ,fixed character length, variable text delimmiter
- From: garyusenet
- Re: how to split a string using ,fixed character length, variable text delimmiter
- From: Oliver Sturm
- how to split a string using ,fixed character length, variable text delimmiter
- Prev by Date: Re: Marshal.Copy IntPtr -> byte[,]
- Next by Date: Re: PropertyGrid population at run time of and XML sub tree
- Previous by thread: Re: how to split a string using ,fixed character length, variable text delimmiter
- Next by thread: Re: how to split a string using ,fixed character length, variable text delimmiter
- Index(es):
Relevant Pages
|
Loading