Jump to content

Matching string to text help


davefootball123

Recommended Posts

I have a statement if (preg_match('/RAINFALL WARNING FOR:[\s\w\-\=NEW=\'\.]+CALEDON/', $svs)) {

 

to match a Rainfall Warning for the town of Caledon...however it is saying there is a match for the text below...this is because CALEDONIA has the same first 7 letters as CALEDON...how would I stop this from matching....

 

Thanks for your help. Dave

697 
WWCN11 CWTO 091842
SEVERE WEATHER BULLETIN
ISSUED BY ENVIRONMENT CANADA
AT 2:42 PM EDT TUESDAY 9 APRIL 2013.
---------------------------------------------------------------------
WATCHES/WARNINGS IN EFFECT FOR SOUTHERN ONTARIO...

RAINFALL WARNING FOR:
=NEW= WINDSOR - ESSEX - CHATHAM-KENT
=NEW= SARNIA - LAMBTON
=NEW= ELGIN
=NEW= LONDON - MIDDLESEX
=NEW= SIMCOE - DELHI - NORFOLK
=NEW= DUNNVILLE - CALEDONIA - HALDIMAND
=NEW= OXFORD - BRANT.

HEAVY RAINFALL INTO THURSDAY.

---------------------------------------------------------------------
==DISCUSSION==
A SERIES OF LOW PRESSURE SYSTEMS WILL GIVE PERIODS OF RAIN TO THE
REGIONS FROM THIS EVENING THROUGH WEDNESDAY AND INTO THURSDAY.
THE RAIN WILL BE HEAVY AT TIMES WITH ISOLATED THUNDERSTORMS ALSO
EXPECTED. RAINFALL AMOUNTS OF 50 TO 80 MM ARE EXPECTED BY THURSDAY.

THE RAIN WILL LIKELY CHANGE TO FREEZING RAIN THURSDAY IN THE LONDON
AND OXFORD AREAS. TO THE SOUTH, NEAR LAKE ERIE, ADDITIONAL RAINFALL
AMOUNTS ARE EXPECTED BEFORE THE RAIN CHANGES TO SOME SNOW FRIDAY.

REFER TO YOUR LOCAL PUBLIC FORECAST FOR FURTHER DETAILS.

END/OSPC
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.