Welcome Guest, Not a member yet? Register   Sign In
regex help needed
#1

(This post was last modified: 05-09-2016, 09:54 AM by cupboy.)

I've been trying to figure this out for awhile, so it must be time to ask for help. How can I get the results I want?

Code:
$subject = '\n   MC - 5-10 OVER IN A CHURCH ZONE    - 12/08/15\n    INF - 1-5 OVER IN A SCHOOL ZONE    - 12/14/15\n';

$matches = preg_split('/ ([MF].|INF|CAP) \-(.*) \- /',$subject, NULL); // also tried: preg_match, preg_match_all
// desired result: 2 string values placed into array
// 1. MC - 5-10 OVER IN A CHURCH ZONE    -
// 2. INF - 1-5 OVER IN A SCHOOL ZONE    -
Reply


Messages In This Thread
regex help needed - by cupboy - 05-09-2016, 09:54 AM
RE: regex help needed - by albertleao - 05-09-2016, 10:40 AM
RE: regex help needed - by Wouter60 - 05-09-2016, 11:06 AM
RE: regex help needed - by InsiteFX - 05-09-2016, 12:43 PM
RE: regex help needed - by cupboy - 05-09-2016, 11:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB