David Rorex schrieb:
On 2/13/06, Michael Stuhr <[EMAIL PROTECTED]> wrote:
i'm trying to use Joey Leott's (Pavils Jurjans') RegExp for replacing
BAD-strings in (to-be-uploaded) Filenames but had no success at all. can
anyone
give me some hints ?

i have:

<code>
import RegExp;

var a:String = 'äur*?ß.png';
var goodname:RegExp = new RegExp ('/[^a-z0-9_\\-\\.]/i', 'g', 'i');
str.text = a.replace(goodname, '_');
</code>

but the compiler says type mismatch in line 6 ....


Can you tell us which line is line 6? You only gave 5 lines of code...

count them. the compiler counts them too :-)
also:
'a' is a string, and you are calling 'a.replace()'. Is that correct? (I
don't know how the regexp library works exactly, so it may be)
it should be. RegExp adds some functions to String() by prototype, sth. like String().replace().
it works (or should work) simpilar like preg_replace() in php.

any ideas ?

micha



micha
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to