Regular expression to split a long string
- From: "Kerry" <nice.try@xxxxxxxxxxx>
- Date: Tue, 16 Aug 2005 19:08:52 -0400
Please help if you can.
I have a web form that has a multiline input box 30 columns by 15 rows. The
maximum length of a user's entry can be 450 characters. I need to read this
data into a series of 15 database fields (each 30 characters wide). I know
this amounts to poor normalization, btu the system is old and cannot be
maintained under the current project.
I need to accept the user's entry in this textbox and split it into (up to)
15 strings, no wider than 30 characters each. Ideally, splits will occur
where newline characters occur or after each 30th character. I have
experimented with many different regular expressions similar to
"((?m:(.{1,30})\n?){1,15})"
but I can't get the separate strings.
Has anyone tried something like this successfully?
.
- Follow-Ups:
- Re: Regular expression to split a long string
- From: shiv_koirala
- Re: Regular expression to split a long string
- From: Ken Tucker [MVP]
- Re: Regular expression to split a long string
- Prev by Date: Re: UserControl - Paint in Design Mode
- Next by Date: Re: Simple Question - Datagrid and Typed dataset
- Previous by thread: Decimal.Parse and Decimal.ToString Methods
- Next by thread: Re: Regular expression to split a long string
- Index(es):
Relevant Pages
|