Jump to content

preg_match_all() Issue


ainoy31

Recommended Posts

I have been over this piece of code for a couple of hours and cannot determine why it does not find a match.  I appreciate a second eye on this.

 

Data:
XVZ020-932300-
Test Me VALLEY-
INCLUDING...York Town...NORTH York Town...HENDERSON...
BOULDER CITY
310 AM PDT THU JUN 29 2011

.DATA...TEST. HIGHS AROUND 101 ON THE WEST SIDE OF THE VALLEY...
AROUND 111 ON THE EAST SIDE. SOUTHWEST WIND 10 TO 20 MPH. GUSTS UP
TO 20 MPH INCREASING TO 30 MPH IN THE AFTERNOON. 
.DATA...CLEAR...BREEZY. LOWS AROUND 79 ON THE WEST SIDE OF THE
VALLEY...AROUND 80 ON THE EAST SIDE. SOUTHWEST WIND 15 TO 25 MPH
DECREASING TO 10 TO 15 MPH AFTER MIDNIGHT. 

$$

 

Script:
if(preg_match_all("/\n[A-Z]{2}[ZC][0-9]{3}[A-Za-z0-9\-\=\+\,\ \.\/\[\]\(\)\:\;\'\"\&\@\#\%\!\,\>\<\n]*?\n\\$\\$/", $data, $match))
{
    print_r($match);
}
else
{
    echo "No Match";
}

 

Much appreciation.

Link to comment
Share on other sites

Darling the point of regex is to:

 

1) either check that something follows a certain determined pattern, or

2) to extract something from a larger text according to a determined pattern.

 

What is that you want to extract or match? Explain and I will help you.

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.