Dan Joseph wrote:
Question:
Where is this number coming from? Couldn't you just use a substr() based
upon it's length and not deal with a regular expression?
Its a bank account number coming from a database. We're reformatting it
for ACH processing. The number could be:
23408234980423
From: Dan Joseph [EMAIL PROTECTED]
I've searched the high heavens for a method of doing this... Here's what
I'm doing... First, the code..
$middlenum = preg_replace(/^.$this-start_num./, ,
$this-ach_acct_num);
$middlenum = preg_replace(/.$this-end_num.$/, , $middlenum);
In a nutshell,
Hi,
Not tested, mind you. I know what you're saying, too. How is _all_ of
that code better(worse?) than one simple regex? Benchmark it and see.
You'll be surprised how a lot more code with simple string functions
will be considerably faster than a complex regular expression. Your
results may
Hi,
In a nutshell, what I want to do is chop off the front and the back.
Example:
I have: 1234567890
I want: 456
I have a start num and an end num. start = 123, end = 7890.
This is working fine as I have it above, however I'd like to combine
it into one regular express,
Dan Joseph wrote:
From John:
$new_number =
preg_replace('/^'.$this-start_num.'([0-9]+)'.$this-end_num.'$/',
'\\1',$old
_number);
The one that Mike gave didn't seem to do anything, John's will work if it
can match the beginning and the end successfully. I should probably explain
myself
Dan Joseph wrote:
Sometimes there won't be anything to replace at the front, and sometimes
nothing at the end. So it'd still need to do the front and/or end wether or
not they both exist.
Is there a way to tweak these to do that?
Question:
Where is this number coming from? Couldn't you
On 08 August 2003 15:39, Dan Joseph wrote:
I've searched the high heavens for a method of doing this...
Here's what
I'm doing... First, the code..
$middlenum = preg_replace(/^.$this-start_num./, ,
$this-ach_acct_num); $middlenum =
preg_replace(/.$this-end_num.$/, , $middlenum);
In a
Hi Everyone,
I've searched the high heavens for a method of doing this... Here's what
I'm doing... First, the code..
$middlenum = preg_replace(/^.$this-start_num./, ,
$this-ach_acct_num);
$middlenum = preg_replace(/.$this-end_num.$/, , $middlenum);
In a nutshell, what I want to do is chop off
Hi,
Question:
Where is this number coming from? Couldn't you just use a substr() based
upon it's length and not deal with a regular expression?
Its a bank account number coming from a database. We're reformatting it
for ACH processing. The number could be:
23408234980423
On 08 August 2003 17:39, Dan Joseph wrote:
Hi,
In a nutshell, what I want to do is chop off the front and the
back. Example:
I have: 1234567890
I want: 456
I have a start num and an end num. start = 123, end = 7890.
This is working fine as I have it above,
10 matches
Mail list logo