Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old October 15th, 2003, 09:07 AM
degz degz is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 degz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Expr Quoting

Hi,

Can anyone help?

Heres what i'm trying to achieve.
a=degz.log

return the part of the string "degz"

here's where i'm at.
a=degz.log
b=`expr index $a "." - 1`
c=`expr substr $a 1 $b`

What I would like to do is substitute $b in the last command for the expr index command, however i'm sure i'm getting something incorrect with my quoting ( or lack of it! )

The command I would like would look something like:
a=degz.log
b=`expr substr $a 1 `expr index $a "." - 1``

Can anyone point me in the right direction please.

Regards
Degz.

Reply With Quote
  #2  
Old November 3rd, 2003, 03:53 PM
Dios Dios is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Garching, Bavaria, Germany
Posts: 88 Dios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to Dios
RE: Expr Quoting

I think it's too late to answer now,
but anyway.

Try this:

<?php
$a = 'a=degz.log';

preg_match('/=(.*)./Ui', $a, $m);
echo $m[1];

echo '<br />', substr($a, strpos($a, '=') + 1, strpos($a, '.') - 2);
?>



Dios ;)

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > Expr Quoting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway