The online racing simulator
[OT] Phone Numbers.
2
(29 posts, started )
hmm, I thought that was dependant on the remaining chars within the class, much like not needing to escape a '.' char if it was the last (or within the last "non-sequential" set of chars)?

I may be wrong, but this is how I've always understood it. If I am, then I've learnt something too



Regards,

Ian
Well, I made a mistake. While testing your example above I used " " (SPACE) instead of "\s" (because "[\s-.]" does not work for Ruby). However, in PHP (and Perl) it works - your regexp should work too by accident.

Consider this:
php5 -r 'echo preg_match("/^[ -.]$/", "+");' # => 1
Character class. Match because PLUS is between SPACE and DOT (man ascii).

php5 -r 'echo preg_match("/^[ .-]$/", "+");' # => 0
No character class.

Again, I used " " instead of "\s"
Thanks splattael

I ran a few tests on the cmdline like your post above and I do see the difference. Mine also works fine using a space char _if_ I escape the '-' char at the end, but I didn't for the above code.

Thanks for pointing this out, I'll remember it for the future



Regards,

Ian
Quote from Dygear :
Quote from FireTracker :**WLVAC SIG 9** [MALE FELL FX NOSE] SOUTH CITY LANES 25 ADDRESS AVE C/S: STREET LA / ROAD PL - M-10 IN: CITY TOA: 07:30 [FireTracker v2.7]

Quote from FireTracker :**WLVAC SIG 9** [UTA] 25 ADDRESS AVE C/S: STREET LA / ROAD PL - M-10 IN: CITY TOA: 07:30 [FireTracker v2.7]

Quote from FireTracker :**WLVAC SIG 9** 75 ADDRESS ROAD C/S: STREET ROAD / LANE LA - G-7 IN: CITY TOA: 02:43 [FireTracker v2.7]

Quote from FireTracker :**WLVAC MUTUAL AID** [1 AMBULANCE TO STAGING AREA] ADDRESS ROAD C/S: STREET LA IN: TOWN 29 TOA: 22:03 [FireTracker v2.7]

Quote from FireTracker :**WLVAC MUTUAL AID** [SIG 38] SPORTING GOODS 2000 MAIN TPK C/S: EAST WEST AVE / ADDRESS ST - A TONES IN: AGENCY 29 TOA: 08:42 [FireTracker v2.7]


Quote from Dygear :

<?php 
array(
    
'larm' => 'WLVAC SIG 9',
    
'type' => 'UTA - Unknown Type Aided',
    
'addr' => '100 ADDRESS AVE',
    
'cros' => 'STREET LA / ROAD PL',
    
'mapl' => 'M-10',
    
'city' => 'CITY',
    
'time' => '07:30'
)
?>



<?php 
preg_match
('/^\*{2}([a-zA-Z0-9\s]+)\*{2} (\[*.*\])*.*? IN: ([a-zA-Z0-9\s-.]+) TOA: ([0-9]{2}:[0-9]{2})^/'$fireTracker$result);
print_r($result)
?>

I was going over this, and I found that it does not get the address (100 Address Ave), cross streets (Street Ln / Road Pl), or Map Location (M-10) in any of the examples posted. Anyone have any clue on how we can do this?

I've added support for the Map Location by myself (You have no idea how proud I am of myself, but the rest seem to be beyond me.)

/^\*{2}([a-zA-Z0-9\s]+)\*{2} (\[*.*\])*.*? [b]- ([A-Z]-[0-9]{2})[/b] IN: ([a-zA-Z0-9\s.-]+) TOA: ([0-9]{2}:[0-9]{2})/

2

[OT] Phone Numbers.
(29 posts, started )
FGED GREDG RDFGDR GSFDG