
yim11
Novice
Oct 17, 2000, 8:00 AM
Post #1 of 6
(344 views)
|
|
Matching help needed
|
Can't Post
|
|
Hello, I have some code that pulls certian information from the subject line of a email. the code is as follows: $catno=""; for each(@tmp) { if ($_=~m"[0-9]") { $catno=$_; } } --------- this code grabs the catno. (in the form ###-####) from the message subject. The problem is the way is written now it will also grab any other numbers it finds with a '-' character. For example, if the subject is "Re: 000-0000 and 123455-123455" will result in the 123455-123455 being extracted, not the 000-0000. I need to alter this code to only match the numbers found immeditately before and after the first "-" found in the string, and ignore any other '-' characters in the string. Any and all help on this is greatly appreciated! TIA~ Jim
|