Re: A RegEx question

2004-07-26 Thread Gunnar Hjalmarsson
Ian Marlier wrote: I'm in the process of writing a script to migrate from one wiki package to another. The old wiki help articles in a series of flat text files. The new one holds everything in MySQL, so I need to parse the text files into a single SQL import script. I've got most of it, but the

Re: A RegEx question

2004-07-26 Thread Ian Marlier
> Ian Marlier wrote: >> Hi, all -- > > Howdy, > >> I'm in the process of writing a script to migrate from one wiki package to >> another. >> >> The old wiki help articles in a series of flat text files. The new one >> holds everything in MySQL, so I need to parse the text files into a single >>

Re: A RegEx question

2004-07-26 Thread JupiterHost.Net
Ian Marlier wrote: Hi, all -- Howdy, I'm in the process of writing a script to migrate from one wiki package to another. The old wiki help articles in a series of flat text files. The new one holds everything in MySQL, so I need to parse the text files into a single SQL import script. I've got m

Re: A regex question

2002-01-14 Thread Tanton Gibbs
PROTECTED]> Sent: Monday, January 14, 2002 5:50 PM Subject: Re: A regex question > Tanton Gibbs wrote: > > > > If you know they will always be around -, then you might be able to do > > something like: > > > > while( $line =~ /(\d\d?-\d\d?)|(T

Re: A regex question

2002-01-14 Thread John W. Krahn
Tanton Gibbs wrote: > > If you know they will always be around -, then you might be able to do > something like: > > while( $line =~ /(\d\d?-\d\d?)|(T+)/g ) { > push @snow, ($1 || $2); #T will be $2, not $1 This won't work because once $1 has been set it retain that v

Re: A regex question

2002-01-14 Thread Tanton Gibbs
If you know they will always be around -, then you might be able to do something like: while( $line =~ /(\d\d?-\d\d?)|(T+)/g ) { push @snow, ($1 || $2); #T will be $2, not $1 } Also, I'm not sure why you had all of the [], they make a character class which is probably not what you want. -