Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Trimming strings

Trimming strings

2004-04-02       - By Bradley Gabe

 Back
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Speaking of regular expressions, can anyone recommend good training
materials or websites for these?

I'm starting to use them more and more as they are wicked fast compared
to the built in jscript String object methods.

-Brad

>//function get filesnamepadframenumberextension
>//this could be simpler in a line, but seperated for clarity
>var string = "myfilename.0001.jpg"
>logmessage (string);
>//eg for name
>var mynameexp = new RegExp(/\w+/)
>var result = string.match(mynameexp)
>logmessage (result);
>//eg for pad
>var mynumexp = new RegExp(/\d{4}/)
>var result = string.match(mynumexp)
>logmessage (result);
>//eg for extension
>var result = string.match(/\w+$/)
>logmessage (result);
>
>Filesystemobject also has methods for extension etc.
>-- ---- ---- ---- ---- ---- --
>http://www.grahamdclark.com
>TD in circulation
>
>
>
>  
>
>>-- --Original Message-- --
>>From: owner-xsi@(protected)
>>[mailto:owner-xsi@(protected)] On Behalf Of Bernard Lebel
>>Sent: April 2, 2004 3:46 PM
>>To: XSI@(protected)
>>Subject: [Script] Trimming strings
>>
>>
>>Hello,
>>
>>Is there are way to trim an string? For instance, I'm getting
>>a file name. I
>>would like to compare this name with other file names, but without the
>>padding and extension (basically to check if there are sequences of
>>different name in the same folder). The problem is that when
>>you get the
>>file name of a file through FileSystemObject, you get the padding and
>>extensions as well.
>>
>>Thanks for any info
>>Bernard
>>---
>>Unsubscribe? Mail Majordomo@(protected) with the following
>>text in body:
>>unsubscribe xsi
>>
>>
>>
>>    
>>
>
>
>---
>Unsubscribe? Mail Majordomo@(protected) with the following text in body:
>unsubscribe xsi
>
>  
>

--
Bradley R. Gabe
Industrial Light & Magic


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1">
 <title></title>
</head>
<body>
Speaking of regular expressions, can anyone recommend good training
materials or websites for these?<br>
<br>
I'm starting to use them more and more as they are wicked fast compared
to the built in jscript String object methods.<br>
<br>
-Brad<br>
<br>
<blockquote type="cite" cite="mid00a401c418f2$ec5ac360$1501a8c0@(protected)">
 <pre wrap="">//function get filesnamepadframenumberextension
//this could be simpler in a line, but seperated for clarity
var string = "myfilename.0001.jpg"
logmessage (string);
//eg for name
var mynameexp = new RegExp(/\w+/)
var result = string.match(mynameexp)
logmessage (result);
//eg for pad
var mynumexp = new RegExp(/\d{4}/)
var result = string.match(mynumexp)
logmessage (result);
//eg for extension
var result = string.match(/\w+$/)
logmessage (result);

Filesystemobject also has methods for extension etc.
-- ---- ---- ---- ---- ---- --
<a class="moz-txt-link-freetext" href="http://www.grahamdclark.com">http://www
.grahamdclark.com</a>
TD in circulation



 </pre>
 <blockquote type="cite">
   <pre wrap="">-- --Original Message-- --
From: <a class="moz-txt-link-abbreviated" href="mailto:owner-xsi@(protected)"
>owner-xsi@(protected)</a>
[<a class="moz-txt-link-freetext" href="mailto:owner-xsi@(protected)">mailto
:owner-xsi@(protected)</a>] On Behalf Of Bernard Lebel
Sent: April 2, 2004 3:46 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:XSI@(protected)">XSI
@(protected)</a>
Subject: [Script] Trimming strings


Hello,

Is there are way to trim an string? For instance, I'm getting
a file name. I
would like to compare this name with other file names, but without the
padding and extension (basically to check if there are sequences of
different name in the same folder). The problem is that when
you get the
file name of a file through FileSystemObject, you get the padding and
extensions as well.

Thanks for any info
Bernard
---
Unsubscribe? Mail <a class="moz-txt-link-abbreviated" href="mailto:Majordomo
@(protected)">Majordomo@(protected)</a> with the following
text in body:
unsubscribe xsi



   </pre>
 </blockquote>
 <pre wrap=""><!---->

---
Unsubscribe? Mail <a class="moz-txt-link-abbreviated" href="mailto:Majordomo
@(protected)">Majordomo@(protected)</a> with the following text in body:
unsubscribe xsi

 </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Bradley R. Gabe
Industrial Light &amp; Magic
</pre>
</body>
</html>