regular expressions??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
$0.05$
Forum Newbie
Posts: 5
Joined: Fri Sep 27, 2002 10:54 pm
Location: Canada
Contact:

regular expressions??

Post by $0.05$ »

okay, i have a text file that im searching through, and it has many instances with text formated exactly like this

Code: Select all

<p class="bizPhone">Phone:
          <strong>
          їb]їSOME PHONE NUMBER IN HERE]ї/b]
          <\/strong><\/p>
now what i want to do, is get the phone number.

here is the code that i have

Code: Select all

<?php
	preg_match_all("/          <p class="bizPhone">Phone:
          <strong>
          (.*?)
          <\/strong><\/p>/", $info, $array);
?>
but it's not catching it - anyone know why?
$0.05$
Forum Newbie
Posts: 5
Joined: Fri Sep 27, 2002 10:54 pm
Location: Canada
Contact:

Post by $0.05$ »

okay, i figured it out, it should be like this

Code: Select all

<?php
preg_match_all("/          <p class="bizPhone">Phone:\n          <strong>\n          (.*?)\n          <\/strong><\/p>/", $info, $array);
?>
Post Reply