[advanced search]
Results from the most recent live auction are here.
12 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Domain Name Industry Newsletter
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 06-08-2008, 02:57 PM   · #1
liam_d
The original NP Emo Kid
 
liam_d's Avatar
 
Name: Liam Dawe
Location: Plymouth, UK
Trader Rating: (28)
Join Date: Jan 2005
Posts: 1,563
NP$: 96.00 (Donate)
liam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to allliam_d is a name known to all
PHP: preg match

Hi all i am new to regex kinda stuff and need to know how to find "$block" within a load of text?


Please register or log-in into NamePros to hide ads
__________________
**Follow Sig Rules** No references to adult sites!

Last edited by liam_d : 06-08-2008 at 03:26 PM.
liam_d is offline   Reply With Quote
Old 06-08-2008, 09:35 PM   · #2
mholt
DNOA Member
 
mholt's Avatar
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,869
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Well, the strpos function is pretty good for finding an occurance within a string: www.php.net/strpos

It will return the first "spot" it finds of any occurrence without the need for regex.

Use regex to find patterns - not static blocks of text. Are you looking for a regex tutorial?
__________________
www.mwholt.com
mholt is offline   Reply With Quote
Old 06-09-2008, 03:50 AM   · #3
NVD
NamePros Regular
 
Trader Rating: (16)
Join Date: May 2008
Posts: 234
NP$: 0.00 (Donate)
NVD is an unknown quantity at this pointNVD is an unknown quantity at this point
preg_match is mainly used to validate data, testing if the input data matches the expression you give. Its not used to find an occurance of data.

Use the strpos as mentioned above, I think its more suited to what your wanting to do.
NVD is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Traffic Down Under Proof is in the Parking http://www.mobisitetrader.com/
Advertise your business at NamePros
All times are GMT -7. The time now is 09:41 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0