Jump to content

Unknown modififer


mb81

Recommended Posts

Hey everyone, I am writing my first really hardcore regex and I ran into a problem.

 

What I am doing is trying to parse elements out of a table that is in a standard format.

 

I built the regex from left to right slowly working through each pattern and I got to this point that worked:

preg_match("|<tr><td>(\d{2}/\d{2}/\d{0,4})</td><td>(\d{4}\*?)</td><td>([\d\w ]*)</td><td>([\d\w ]*)</td><td>|",$thisfile,$matches);

When I added the next section to test for "TBA" or a time (##:## or #:##), shown here:

preg_match("|<tr><td>(\d{2}/\d{2}/\d{0,4})</td><td>(\d{4}\*?)</td><td>([\d\w ]*)</td><td>([\d\w ]*)</td><td>(TBA|\d{1:2}))|",$thisfile,$matches);

It gave me this error: unknown modifier '\', it doesn't seem to like it after the or '|' operator, I tried to switch them and it didn't like that either, saying the "T" was an unknown modifer. There is nothing in the tutorials that I am referencing that say anything about it. Can someone help?

 

Thanks,

Matt

 

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.