[advanced search]
Results from the most recent live auction are here.
19 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
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,562
NP$: 91.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

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
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,867
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?
__________________
FREE: Help With Code

Includes other technical topics:
programming, development, Windows, domain names, and Internet
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: 202
NP$: 40.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
http://www.mobisitetrader.com/ Special Offer NameChatter
Advertise your business at NamePros
All times are GMT -7. The time now is 08:36 PM.


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