hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : ereg
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

ereg

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-30-2003, 08:33 PM
Research Names Research Names is offline
Web Hosting Master
 
Join Date: Nov 2002
Posts: 713

ereg


Where do the backslashes go on this expression?
if (ereg('The Duck Lists -&nbsp; Last Update: <!--webbot bot="Timestamp" S-Type="EDITED"
S-Format="%Y-%m-%d %I:%M %p" startspan -->(*)[AM|PM]', $domainlist, $parts)) {

__________________
Quality web hosting PullHost.com

Reply With Quote


Sponsored Links
  #2  
Old 12-01-2003, 06:01 AM
Reptilian Feline Reptilian Feline is offline
Web Hosting Master
 
Join Date: Jul 2002
Location: Sweden
Posts: 2,065
Re: ereg

PHP Code:
if (ereg('The Duck Lists -&nbsp; Last Update: <!--webbot bot="Timestamp" S-Type="EDITED"
S-Format="%Y-%m-%d %I:%M %p" startspan -->(*)[AM|PM]'
$domainlist$parts)) { 
Is this the pattern you want to find?
'The Duck Lists -&nbsp; Last Update: <!--webbot bot="Timestamp" S-Type="EDITED"
S-Format="%Y-%m-%d %I:%M %p" startspan -->(*)[AM|PM]'

If I'm not mistaken... when a string is inside single quotes (') you don't need to escape anything with \.

__________________
"Stop flame-wars - Report a post"
The original Kitty Lizard

Reply With Quote
  #3  
Old 12-02-2003, 07:10 AM
Burhan Burhan is offline
Community Guide
 
Join Date: Jul 2003
Location: Kuwait
Posts: 5,100
The only time you need to escape " is when your string starts with "

PHP Code:
$string "This \"word\" needs escaping";
$string2 'This "word" does not'
Its prudent to point out that

PHP Code:
$string "hello";
echo 
'$string\n';
echo 
"$string"
Will result in :
Code:
$string\nhello
(when a variable is encapsulated in ' ' it does not get interpreted).

__________________
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise

Reply With Quote
Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?