Avatar of dolan2go
dolan2go
Flag for United States of America asked on

Exclude 3 characters in a REGEX

I am trying to exclude 'DFP' and it's adjoining time from being found by the regex. With an input string $day example:

..<omitted>...MIA 09:15<br />DEN 10:15<br />DEN 11:20<br />MIA 12:30<br />DFP 12:45.....<omitted>
(this is only an example. I haven't seen anything that would allow me to use look-ahead or behind)

$times becomes:
   [0] => Array
        (
            [0] => MIA 09:15
            [1] => DEN 10:15
            [2] => DEN 11:20
            [3] => MIA 12:30
            [4] => DFP 12:45
        )

Is the [^DFP] used somehow in here?
preg_match_all ( '/[A-Z]{3} [0-9]{2}:[0-9]{2}/', $day, $times );

Open in new window

Regular Expressions

Avatar of undefined
Last Comment
ddrudik

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ddrudik

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
ozo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
dolan2go

ASKER
Good going!! That was the ticket to success. Thanks to you both.

David
dolan2go

ASKER
Great answer. Thanks.
ddrudik

Thanks for the question and the points.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck