Regex Validation Expression For Password That Allows For Only Alphanumeric Values
Apr 19, 2010
I'm trying to setup a RegexpValidator that only accepts a string of alphanumeric characters between 6-30 characters long and requires one number. I'm new to Regular Expressions and everything I've tried seems to keep returning an invalid ValidationRsultEvent.[code]
find the suitable regular expression to validate a string that has comma separated numbers, for e.g. '1,2,3' or '111,234234,-09', etc. Anything else should be considered invalid. for e.g. '121as23' or '123-123' is invalid. I suppose this must be possible in Flex using regular expression but I can not find the correct regular expression.
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?
so im trying to figure out regular expressions in Flex, but cant for the life of me figure out how to do the following.From the sample below, i need to extract out only "Mike_Mercury".So i have to somehow strip out everything around it with RegExp, or whatever's best. Also, I would need it to work with other samples as well. Im getting this from the reddit api, so id have to extract that same section from a whole bunch of these.
I'm trying to find the number of newlines in a string using the Actionscript 3.0 RegExp engine. Using the string.match function and RegExp(" ","g") does not find the newlines in a string which contains newlines. Is there something I need to add to the pattern or something else that I am missing?
i have a problem while username and password validation.i retrieved data (username and password)from an xml doc using http service but the problem is that i have to verify the username and password entered by he user with the username and password of the xml doc...
give me the Regular Expression that can check if a given string has any HTML code in it, and coming to think of it I would be bothered with <a href="something">something</a> exactly.
I've been struggling with this problem for a while:I have a string containing HTML and I'm using a regular expression to get the characters between the tags. I'm then attempting to apply a TextFormat to those characters.The problem is that I'm using the TextField's "htmlText" property instead of it's "text" property (because I don't want the HTML tags to be visible). So, the character index that's returned from the regular expression is incorrect, when I apply the TextFormat.Here is some sample code which illustrates the problem:
var txt:String = "<b>Sample</b> string with bold text"; var tf:TextField = new TextField(); addChild(tf);
I need a AS3 regular expression that allows me to find/replace in strings like these:
[Code]...
I want to be able to replace the spaces at the beginning (inside the > <) for other character. It shouldn't affect the number of character at the right of the spaces or the attributes in the value1 definition.
I have a situation where I might be getting one or both of a pair of characters and I want to match either.
For example: str = 'cddd a dfsdf b sdfg ab uyeroi'
I want to match any "a" or "b" or "ab". If the "ab" comes together I want to catch it as a single match (not as two matches "a" "b"). If I get "ab" it will always be in that order ("a" will always precede "b")
What I have is: /[ab]|ab/
But I'm not sure if the ab is going to be a stronger match term than the [ab].
I have piece of ActionScript code which is supposed to evaluate a string of HTML and break it up into individual pieces. So a string like <p>Hi</p><span>Hi</span><a href="index.php">Hi</a> would be translated into:
However, when I run a test version of this code, I get a value of null in return. I'm pretty sure my regexp string is good, but I'm doing something wrong in ActionScript. My code is below: var evaluatedInput:RegExp = new RegExp('/<([A-Z][A-Z0-9]*)[^>]*>(.*?)</1>/'); var output:Object = evaluatedInput.exec("<p>Hi</p><span>Hi</span><a href="index.php">Hi</a>"); trace(output);
for instance distance values,and temperatures For instance say I have a string containing some unknown inches value And the inches sign can either be the proper double prime OR double quotes. So, I'm guessing as a first step I would search for double prime or double quotes preceded by a number value, then parse out and convert this number value. But this doesn't seem foolproof for instances when it is actually a doublequote, NOT an inches sign
I've created a custom textInput componenet that handles it's own validation using a private validator. The validation is enabled depending on the state of the component i.e. validation is enable when the components state is "edit".However, when the state changes from edit the internal validator is set to not enabled but the validation errors on the textbox do not clear - the textInput still has the red border and on mouseover the validation errors come up. What I want to happen is that when a validator is disabled the error formatting and error messages clear from the text input control.
Does anyone have any idea how to do this I tried setting the internal validator instance to enabled = false and dispatching a new focusOutEvent as below but the validation error formatting is still applied to the textInput contrl.
_validatorInstance.enabled = false; //clear the validation errors if any dispatchEvent(new FocusEvent(FocusEvent.FOCUS_OUT));
I am having a flash application where I want to send parameters to it via the javascript from a defaul.aspx page. I have a parameter called Id where it can accept alphanumeric values. The query string in the url works fine if I enter just numbers for the Id, and takes me to the specific page related to that id , but if I enter a combination of numbers and characters like 001A , it does not work.
This is the code I used <script type="text/javascript"> function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0; i<vars.length; i++) { [Code] .....
And then passed the flashvars into swfobject.embedSWF. I also don't want to change anything in my mxml files in flash side.
I have a problem with flashvars , when I read the url from browser if I have assigned just numbers to Id (my paramter in url) ,everything works fine, but if my id includes character, then it does not work , I don't want to change anything in flash side in mxml files, I want to do it with javascript
here is my code
<script type="text/javascript"> function getQueryVariable(variable) {
I have a project that involves taking user input from a keyboard/numeric keypad. The script I wrote detects when the user actually enters a numeral in the text area, and replaces it with step-by-step with a series of letters and numbers in a similar fashion to keypad input on a phone. Everyone else's solution assumes that the user is A.) On an actual mobile device, and B.) That the LAST character is the one that should be replaced in the series.
Whereas, in my case, the user can use standard keyboard/numeric keypad input. Moreover, the caret should be able to move to any arbitrary position within a given string of text, and not just to the end of that string. My script works for the most part, except for some reason, the caret advances on its own without me/the user telling it to, and from what I can see, there's nothing in the code to allow for this:
Code: var _1:String = "1@._-"; var _2:String = "2abc"; var _3:String = "3def"; var _4:String = "4ghi"; var _5:String = "5jkl"; [Code] .....
Lastly; my code does not account for when a user presses a DIFFERENT number than the one that they are currently pressing--in which case the caret should naturally advance automatically to allow for a new numeral to be inserted. My example is attached.
Im new at actionscript, and I am making a very project. Basicly, I have some thing were there is a page you can get to by beating other parts of the 'game'. I want to add some sort of a password or save feature to people can type in the password of something at the opening screen and jump to that page.
I have an array which holds objects. The objects have properties called cat and title. The cat property can hold values like: Cat 1 Cat 2 Cat 3
And the title property can hold values: Title 1 Title 2 Title 3
So that you wind up with something that looks like Cat 1 Title 1
Cat 1 Title 2
Cat 2 Title 3 etc.
Now, I want to sort these, but we all know that Array.sortOn(["cat", "title"]) will produce results like: Cat 1 Cat 10 Cat 11 Cat 2 Cat 3
What's the most efficient method of sorting these properly (so the number component sorts like a number and not like a string)? I can request users pad their entries (yes, other people will be entering this data), but that's both a little bit ugly and not very user friendly.
Possible Duplicate:In Flash, how would I run an e4x statement when that statement is stored in a String?I know there is an existing question regarding this problem, but it got no replies.Ideally, I would like to stick an e4x expression in a string and run it.
var tempXML:XML = someXML; var stringe4x:XML = "pictures.picture.(size > 200)"; tempXML.eval(pictures); //something instead of eval
Since AS3 doesn't have eval, this doesn't work; however, there is the ability to use elements() and attributes() to get the elements or attributes on the same XML node level, but this doesn't work for the more complicated e4x filters such as "(id > 300)" or ".." notation.
I'm new to these forums and to actionscript as well, so please excuse my lack of clarity when explaining this situation, I'm learning on my own and in my free time!This isn't really a problem in the sense that I've found a workaround to it, but it's bugging me that I don't understand what's going on in this situation. In the last couple of weeks I have been working on a gridless pathfinding solution for a point & click game, I finally got it done, but I was stuck at some point for a few days and I discovered that there was an x property of a point I was referencing that kept changing back to a previous value assigned to it. I don't know if I'm making any sense, but so you guys see what I'm talking about:
but instead of displaying "Rose" it displays"_root.fabric01_chip10_name" Basically I need to get the literal value to equal an expression- how do I do this?
I am scripting a button and something like this: _root.READ = ("image6"); takes me exactly where I want, the frame labeled "image6" However i want to reuse this button and I want to switch it to something like: _root.READ = (trace(this._name)); where it calls upon the instance name (image6). However, this doesn't work, and I believe it's because there are no quotes around the word. Is there someway I can output what the trace calls and put it in quotes?
I need to convert a string such as "x*y+2" (from an input text field) into an expression x*y+2, so that it can be evaluated normally, eg f=x*y+2. The variables x and y are already defined and can have various values; I need to evaluate the strings as expressions.
I have tried f=Number("x*y+2") but it seems to work only when the string is actually a number such as "1.2e-4".
So why can I evaluate an expression in a switch like so:
[Code]...
If I trace vidList[currentIndex].video before the switch I get "city" but tracing vid after the switch I get null Quickly solved by just assigning to a variable and then using that in the switch... but it still seems odd I can't just do it directly.