Regex :: Replacing Backslashes With Forward Slashes?
Feb 10, 2010
var aText:String = "C:\folder\folder\file";
var filterVal:String = aText.toLowerCase().replace( ///g, '/');
trace( aText );[code]....
this code was based on this site and nascent regex skills.What am I doing wrong?
View 1 Replies
Similar Posts:
Nov 25, 2009
I'm using Ant with FDT 3 and I have Ant creating a jsfl to compile fla's. When I use the built in '${basedir}' property in Ant it gives me the path with backslashes() in it because I'm on Windows. The problem is that when its run through jsfl the slashes are taken as escapes. I need to know how to modify the basedir property so the slashes are converted to forward slashes. I've tried splitting the basedir on backslashes in jsfl and joining it with forward slashes as a delimiter, but the backslashes still cause problems.
So what I need to know is how to change the basedir in Ant to have forward slashes?
View 1 Replies
May 23, 2010
After the double forward slashes in the website address, the rest of the line gets greyed or commented out in the Script Pane.[code]
View 8 Replies
Nov 7, 2009
i'm trying to do a string replace with but can't seem to get the regular expression right. change "/portfolio/2/3/" to "portfolio_2_3"? Basically I want to remove the leading and following slashes, and convert all the other slashes to underscores.
View 2 Replies
Jun 6, 2011
I have absolutely no knowledge in Regex whatsoever. Basically what I'm trying to do is have an error class that I can use to call errors (obviously) which looks like this:
package avian.framework.errors
{
public class AvError extends Object
{
[Code].....
The idea is to replace {0} with the first parameter parsed in ...params, {1} with the second, etc.
I've done a bit of research and I think I've worked out that I need to search using this pattern:
var pattern:RegExp = /{d}/;
View 3 Replies
Dec 30, 2009
I am creating an application in Flex that uses an embedded SQLite database. The data in the database contains quotes and other special characters which are escaped using a backslash or ''.Before I retrieve the data and render it in a Flex text area control I want to remove the ''. Is there any function in Flex which can help me do this - some equivalent of stripslashes() in PHP?
View 1 Replies
Oct 1, 2009
I've made a project which uses double slashes ("\") on paths for source files like sounds,xml etc. It works fine on a CD but I want to uploaded on a server.The swf files which use those paths work fine on IE but not on firefox,safari,opera etc. I red that the problem is the slashes that I used in paths. They should be backslashes like "/Sounds/somesound.mp3" and not "\Sounds\somesound.mp3".I found that firefox translates "\Sounds\somesound.mp3" to a single file named "Soundssomesound.mp3", the directory "Sounds" now turns to a part of the filename.
If I place and rename the source files like "Soundssomesound.mp3" on the server in the same directory with the swf file (not in "Sounds" directory) this way works on firefox, but does not work on IE. I have to place the source files in both ways to work in all browsers but that's not good...I know that the best thing that I can do is to change the path syntax in fla's but the project is to big.
View 1 Replies
Jul 29, 2010
I'm using flash and php to write or overwrite a text file (an xml file). I have text strings that contain the xml data, which then get parsed by the php file.
It works fine. However, I notice that the header in the XML file <?xml version='1.0' encoding='utf-8'?> get's replaced with <?xml version='1.0' encoding='utf-8'?>
Why would slashes get added?
[Code].....
View 2 Replies
Apr 1, 2009
Problem is that my rewind and fast forward buttons do not work properly in the sense that they start to mess up when you fast forward or rewind past the current scene. It seems to just skip through the whole movie and totally mess up the animation.the code for the controls is on a single layer and reads as the following:
stop();
play_btn.onRelease = function (){
play();
[code].....
View 4 Replies
Mar 5, 2011
I have been working on a tutorial in Flash on the topic of Flash () for two days, and I am just finishing up on a template. I have fixed five bugs, but I cannot think of how to fix this last one. I'd rather actually fix the problem this time, instead of improvising . So, here is what is going on:
I have this thing at the end where you have to enter in the code that I taught the viewer to proceed, then hit the continue button to finish the tutorial. But for some reason, whenever I try to go back with the back arrow, it does, but then I can't go forward with the forward arrow until I reach the first frame that contains actual tutorial ("page" 2). Then it works again. It seems really random, but there is [obviously] a good explanation for it. I thought it might have something to do with the fact that all of the arrows up to the "test" part, excluding the back arrow there, have the exact same instance name. However, "page" 2 is the 2nd time it is used (introduction, then the "page" 2, then 3, 4, 5, and 6, then the test part thing), so it makes less sense that it would work the 2nd time, but not the third, fourth, fifth, or sixth. And I know there's nothing wrong with the code itself:
[Code]...
View 3 Replies
Mar 24, 2011
I have exported data .xls file using as3.
var xml:ArrayCollection;
xml=Labneuron8.lastResult.Response.Terminal as ArrayCollection;
var str:String=xml[0].Value;
var xml1:XML=new XML(str);
[Code]...
View 3 Replies
Jul 15, 2010
I have this regular expression to get urls:
(((ht|f)tp(s?))://)?(www.|[a-zA-Z].)[a-zA-Z0-9-.]+.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(:[0-9]+)*(/($|[a-zA-Z0-9.,;?'+&%$#=~_-]+))*
And I want to modify it so that when I call to make an array of the matched strings it will get everything before it as well.
View 1 Replies
Aug 7, 2010
Regexp for AS3 to get the domain name from URL?[URL]
View 2 Replies
Feb 19, 2011
So we have [URL] we need to get out from it protocol, ip/adress, port, actual url (robot10382.flv here) and actions (action=read here) how to parse all that into string vars in one reg exp?
View 2 Replies
Mar 21, 2011
For example, I've got var for RegEx DSX-?2 I need add this var to RegEx and get this .match(/DSX-?2/gi)
View 2 Replies
Mar 21, 2011
I'm working with some Action Script file and I found this:
var pattern:RegExp = /.*//
var results:Array = pattern.exec(cardImageService.url);
I know it's a regular expression and that exec() is looking for my pattern in my string. But how should I understand this pattern?
View 5 Replies
Jul 11, 2011
Using Actionscript 3.0 (Within Flash CS5)A standard regex to match any digit is:
var myRegexPattern:Regex = /d/g;
What would the regex look like to incorporate a string variable to match?(this example is an 'IDEAL' not a 'WORKING' snippet) ie:
var myString:String = "MatchThisText"
var myRegexPatter_WithString:Regex = /d[myString]/g;
I've seen some workarounds which involve creating multiple regex instances, then combine them by source, with the variable in question, which seems wrong. OR using the flash string to regex creator, but it's just plain sloppy with all the double and triple escape sequences required.There must be some pain free way that I can't find in the live docs or on google.
View 2 Replies
Dec 1, 2011
At the moment, I have the following regex for replacing a URL to a HTML hyperlink:
[Code]...
View 2 Replies
Aug 13, 2010
Basically I am using UTF-8 characters codes u0000 to u0008 as part of a socket server.I need a little regex pattern to replace these chars with somthing like a $ symbol to make them really obvious (while tracing output etc..).I believe it should be something like:
Code:
filter:RegExp = new RegExp("[u0000u0001u0002u00..]");
myNewString = myString.replace(filter, "%")
View 6 Replies
Nov 20, 2009
When I use the code in red once my cursor has replaced the mouse i can no longer click on my boxes. When i do not use the hide mouse code i can click the boxes just fine. What am I doing wrong? [code]
View 1 Replies
Jul 28, 2011
I have a main shell swf file that has two buttons on it that should each launch/load their respective swf files (tool1, tool2). These should essentially replace the main swf file. Also, I have a button on tool1 & 2 that should bring you back to the main menu. All these files are then compiled into an exe. Seems easy enough, but I'm not entirely sure where to start.
So far I have:
import flash.display.*;
import flash.net.URLRequest;
tool1_btn.addEventListener(MouseEvent.CLICK, gotoTool1);
function gotoTool1 (e:MouseEvent):void{
Loader(this.parent).load(new URLRequest("tool1.swf"));
}
View 2 Replies
Mar 4, 2009
My code is attached - I'm trying to replace the loaded pngfile with the next one to load everytime the swf loops. The codeattached is on the first frame of the timeline and it just loadsthe next png on top of the old one. Any time I try to put anunload() or a removeChild(myBitmap), nothing displays. I could havesworn that the way I'm using load() it would just replace the
View 4 Replies
Jul 9, 2009
I've got music player and one of the controls is a movieclip which acts as a PLAY and PAUSE button. What I would like is to swap the image of this movieclip everytime it's clicked. How would I go about doing this? Here's my code...
[Code]...
View 1 Replies
Jun 15, 2010
Simple Question: Is it enough to add the Child to be replaced to another DisplayObjectContainer or must it be manually removed from the former one before?
View 1 Replies
Jul 21, 2010
I am trying to use sIFR to replace the headlines (e.g. The Tour of A Lifetime) on this page: [URL] The font I want to swap in is Verlag by hoefler & frere jones. I had this working the other day but it suddenly stopped working: the font does not replace. All the js/css/flash files are linked correctly. I tested my verlag.swf and it works. And, I tested sIFR with a different font and the replacement worked. Am I having issues because I have yet to buy a Verlag license for the server?
View 1 Replies
Nov 20, 2009
When I use the code in red once my cursor has replaced the mouse i can no longer click on my boxes. When i do not use the hide mouse code i can click the boxes just fine. What am I doing wrong?
[Code]...
View 1 Replies
Jul 6, 2009
In AS2 I sometimes like to be able to just wipe everything off in one clean swoop and replace it with a new SWF.Which is of course uber simple, simply "_root.loadMovie("new_world.swf");"
View 4 Replies
Dec 13, 2010
I'm working on a project for the new year gathering at our work. I made an application in which you can type a wish for the company and when you send it your message will be displayed in an dynamic text field and in the background fireworks are launched. These fireworks are external swf files, made in adobe after effects. They are launched when clicking a button. They are played at random. However, after playing 2 or 3 they start slowing down, probably because they stack on each other. I need the new swf to replace the old swf, now my application keeps loading new swf on top of each other.
View 1 Replies
Jun 25, 2009
I have this:
var regExp:RegExp = new RegExp("((.*?)%)");
and want everything between the ( and the %)the string looks like this: (-24%)I now get a return back "(-24" and have searched for a long time to find a solution but didn't find any.
View 2 Replies
Mar 11, 2010
I've written a url validator for a project I am working on. For my requirements it works great, except when the last part for the url goes longer than 22 characters it breaks. My expression:/((https?)://)([^s.]+.)+([^s.]+)(:d+/S+)/i
It expects input that looks like "http(s)://hostname:port/location". When I give it the input: https://demo10:443/111112222233333444445
it works, but if I pass the input https://demo10:443/1111122222333334444455
it breaks. You can test it out easily at[URL].. Oddly, I can't reproduce the problem with just the relevant (I would think) part /(:d+/S+)/i. I can have as many characters after the required / and it works great. Any ideas or known bugs?
[Code]...
View 2 Replies