![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
PornSiteDomains.com
Industry Role:
Join Date: Oct 2002
Location: US
Posts: 1,265
|
![]() Using php I would like to detect something in a string depending on whether the part immediately after the matched part does not contain certain characters. I think I may need to use a lookahead negative assertion as explained here but it is not working as I would expect so not sure. So for example:
Code:
$string = 'test aadfadf random text kalkdfjakdf>apple peach orange'; I tried Code:
if(preg_match("/test(.*)>(?!apple))/i",$string)){ echo 'true since apple does not follow > in string'; }else{ echo 'false since apple follows > in string'; } |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
|
try stackoverflow, i do the same and get issues solved within minutes...
first thing make sure you have regex part correct ... and then the php is the very easy.
__________________
SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
PornSiteDomains.com
Industry Role:
Join Date: Oct 2002
Location: US
Posts: 1,265
|
ha, I did endup there and your right got answer right away, had an extra parenthese at the end. Thanks for the reply.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
|
np, just hit the thanks button.
__________________
SSD Cloud Server, VPS Server, Simple Cloud Hosting | DigitalOcean
|
![]() |
![]() ![]() ![]() ![]() ![]() |