Re: Help splitting fields with regexp

2005-12-15 Thread DZ-Jay
[EMAIL PROTECTED] wrote: ok. well i don't have formal reg exp training,. i've used an oreilly pres book to teach myself and have been told by others that i seem really good with them. considering what i've seen here, Brian Raven and Bill Luebkert are both much better and also explain VERY well.

Re: Help splitting fields with regexp

2005-12-13 Thread JPerlmutter
dZ- DZ-Jay <[EMAIL PROTECTED]> wrote on 12/12/2005 01:50:54 PM: > On Dec 12, 2005, at 08:53, [EMAIL PROTECTED] wrote: > > > DZ- > > > > reg exp is greedy by default, but perl has a modifier to stop that. > > Thanks, I was aware of that. ok, i just wanted to be sure. > > > haven't tested to pr

Re: Help splitting fields with regexp

2005-12-12 Thread DZ-Jay
On Dec 12, 2005, at 07:51, Brian Raven wrote: First, could you modify your posting style. It is impossible to determine from the above who said what. Sorry, I just noticed this. I was having problems posting from my mail client and I copy+pasted the source of the message into an SMTP telnet

Re: Help splitting fields with regexp

2005-12-12 Thread DZ-Jay
Reposting with quotes include (sorry!). See below. On Dec 12, 2005, at 04:40, $Bill Luebkert wrote: DZ-Jay wrote: But I did specify the rules: 1. Split on a specified delimiter (for the moment I'm aiming for [,;]), but ideally I would like it to be variable. 2. As opposed to CSV where quot

Re: Help splitting fields with regexp

2005-12-12 Thread DZ-Jay
On Dec 12, 2005, at 08:53, [EMAIL PROTECTED] wrote: DZ- reg exp is greedy by default, but perl has a modifier to stop that. Thanks, I was aware of that. haven't tested to prove that works correctly, but in theory it should. ? immediately after * or + will make it non-greedy I forgot to m

Re: Help splitting fields with regexp

2005-12-12 Thread Williamawalters
In a message dated 12/12/2005 6:38:31 A.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > I agree, and I am also self-taught and certainly not an expert at> regexps.  I would like to get a single regexp, if possible, as a matter if by ``single regexp'' you mean a one-liner, i would str

Re: Help splitting fields with regexp

2005-12-12 Thread JPerlmutter
DZ- reg exp is greedy by default, but perl has a modifier to stop that. where .* is greedy, .*? is not so given: josh made this regexp example to show how josh can use a modifier and stop it from going past josh and: (.*)josh modify to (.*?)josh and now you get nothing. josh is at the begi

RE: Help splitting fields with regexp

2005-12-12 Thread Brian Raven
[EMAIL PROTECTED] <> wrote: > On Dec 12, 2005, at 04:40, $Bill Luebkert wrote: > > DZ-Jay wrote: > > But I did specify the rules: > 1. Split on a specified delimiter (for the moment I'm aiming for > [,;]), but ideally I would like it to be variable. > 2. As opposed to CSV where quoted strings en

Re: Help splitting fields with regexp

2005-12-12 Thread dz
On Dec 12, 2005, at 04:40, $Bill Luebkert wrote: DZ-Jay wrote: But I did specify the rules: 1. Split on a specified delimiter (for the moment I'm aiming for [,;]), but ideally I would like it to be variable. 2. As opposed to CSV where quoted strings encompass the entire field, quoted substrings

Re: Help splitting fields with regexp

2005-12-12 Thread $Bill Luebkert
DZ-Jay wrote: > But I did specify the rules: > 1. Split on a specified delimiter (for the moment I'm aiming for [,;]), > but ideally I would like it to be variable. > 2. As opposed to CSV where quoted strings encompass the entire field, > quoted substrings can exist within the field. > 3. The qu

Re: Help splitting fields with regexp

2005-12-11 Thread DZ-Jay
On Dec 11, 2005, at 09:06, $Bill Luebkert wrote: DZ-Jay wrote: Pretty ingenious, albeit a bit of cheating, uh? :) but if all else fails, I'll probably go with that, thanks! I still wonder if there is a single regexp that could do what I want, and if so, I'd like to learn about it. I'm just

Re: Help splitting fields with regexp

2005-12-11 Thread $Bill Luebkert
DZ-Jay wrote: > Pretty ingenious, albeit a bit of cheating, uh? :) > but if all else fails, I'll probably go with that, thanks! > > I still wonder if there is a single regexp that could do what I want, > and if so, I'd like to learn about it. I'm just not very familiar with > backtracking and

Re: Help splitting fields with regexp

2005-12-11 Thread DZ-Jay
On Dec 10, 2005, at 22:54, $Bill Luebkert wrote: $_ = q{"LastName, First Name" , "Name" , ; FirstName LastName, address; "First \"nick\" Last" address}; s/\\"/\003/g; # handle embedded \" s/"([^"]+)"/\001$1\002/g;# handle open/close

Re: Help splitting fields with regexp

2005-12-10 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > Hello: > I'm trying to build a routine to split a string in fields by a > specified delimiter. The string format is pretty close to CSV, except that > quoted substrings can appear within an unquoted string, and escaped quotes > can exist within quoted strings,

Re: Help splitting fields with regexp

2005-12-10 Thread Williamawalters
In a message dated 12/10/2005 7:04:59 P.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > Hello:> I'm trying to build a routine to split a string in fields by a specified delimiter.The string format is pretty close to CSV, except that quoted substrings can appear within an> unquot