|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 ;) |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Server Administration > Expr Quoting |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|