This is great - thanks for explaining, helps a lot.
the original expression I posted works this tool : http://gskinner.com/RegExr
I would love to know what magic Grant is using to get it working in his RegExp
utility.
Thank you Anthony.
On 11 Mar 2011, at 23:42, Anthony Pace wrote:
Hi
I seem to be having some mixed results with this one:
var tStr: String = '-path:c:\test path\temp -param spaced string -x'
var patt: RegExp = new RegExp(
'(?=[-{1,2}|/])(?Pname[a-zA-Z0-9]*)(?::|=)*(?Pvalue[\w|.|?|=||+|
|:|/|\\]*)(?=[ |]|$)' , 'g');
var result : Object =
Hello lovely list...I am trying to run a RegExp pattern on a String, and am not
too sure why it's not working, and am not too sure why.
Here is the code:
var tStr: String= '/a:value -big=this -test:123 -test2=th_3'
var r : RegExp= new RegExp(
I just plugged it into RegExr http://www.regexr.com and I can't make sense
of it.
Try using that tool to build it. It really helps
On Fri, Mar 11, 2011 at 5:56 AM, Karim Beyrouti ka...@kurst.co.uk wrote:
Hello lovely list...I am trying to run a RegExp pattern on a String, and am
not too sure
Hi Karim and Ktu,
Below is an explanation of what appears to be going on in the given pattern:
(?:\s*)
is a greedy non-capturing group of whitespace
(?=[-|/])
is looking behind the next section of the expression, (?name\w*),
for, what is in this case, a character set; as well, it does so
Looks like it worked.
Tried a dozen OCR sites and none could match any letters.
There may be a super OCR bot somewhere, but not really worried.
Anyone know of somewhere I can test further, similar to what the bots
use?
I figure this question may have a taboo answer, just want to be sure.
I guess you were using AS2? There is no native RegEx in AS2, though, so I don't
see how you were going to use AS3 in AS2. In AS3, you should NEVER use anything
other than ints to iterate integer values. Don't use uint, and don't use Number.
That code I provided is code I wrote and tested in
And just to add to this, in AS3, I never use Array anymore for the very reason
that passing an out of range value returns undefined instead of throwing an out
of range error. So, I always use Vector.
___
Flashcoders mailing list
Ah, yes, I thought I has stated that. I am using AS2.
I tried setting the Math.random first and then I used Math.floor,
that seemed to work,
but I put an extra catch and set up a..
if(ranCode == undefined){
ranCode = 0;
}
and so a zero gets added instead of any undefined
and that
RegEx isn't really used for what you're talking about.
You should use ascii codes to create your alphanumeric array and then choose
random indexes from it to create your random string.
var i:int;
var alphaNumeric:Array = [];
for (i = 97; i 123; ++i)
{
Ah thanks Steve.
So is 97 to 123 the placement of upper and lowercase letters and the
numbers on the CharCode chart?
and are the upper and lowercase letters 32 letters apart on the chart?
Trying to understand where you got these values. Your solution is
very good and interesting to me.
Also,
http://www.asciitable.com/
a-z = 97-122
A-Z = 65-90
97 - 65 = 32
a-z = 26 letters
A-Z = 26 letters
0-9 = 10 numbers
26 + 26 + 10 = 62
On 6/16/2010 11:15 PM, Karl DeSaulniers wrote:
Ah thanks Steve.
So is 97 to 123 the placement of upper and lowercase letters and the
numbers on the CharCode
Nice! Thank you.
On Jun 17, 2010, at 2:49 AM, Steven Sacks wrote:
http://www.asciitable.com/
a-z = 97-122
A-Z = 65-90
97 - 65 = 32
a-z = 26 letters
A-Z = 26 letters
0-9 = 10 numbers
26 + 26 + 10 = 62
On 6/16/2010 11:15 PM, Karl DeSaulniers wrote:
Ah thanks Steve.
So is 97 to 123 the
: [Flashcoders] regExp
Nice! Thank you.
On Jun 17, 2010, at 2:49 AM, Steven Sacks wrote:
http://www.asciitable.com/
a-z = 97-122
A-Z = 65-90
97 - 65 = 32
a-z = 26 letters
A-Z = 26 letters
0-9 = 10 numbers
26 + 26 + 10 = 62
On 6/16/2010 11:15 PM, Karl DeSaulniers wrote:
Ah thanks
If don't want to learn the ascii codes by heart (or look them up), you can
use charCodeAt() like this:
var first:int = (A).charCodeAt(0);
var last:int = (Z).charCodeAt(0);
for (var i:int = first; i = last; i++) {
trace(String.fromCharCode(i));
}
Cheers
Juan Pablo Califano
2010/6/17 Karl
Thanks Juan, Thanks Jim.
@Steve
I noticed with your example I get undefined as one of the results.
Also, I had to change the var i:int; to var i:number = 0;
I got an error with int saying it could not load the class or
interface for int.
What am I missing here?
TIA
Karl
On Jun 17, 2010, at
Hi I have an array that I think could use some shortening.
It is an array of the alphabet and numbers that I use to get a random
letter/number combo from.
I am sure there is a better way to do this. Maybe a regExp?
In essence, I want to get a random combo of Upper and lowercase
letters and
Very nice!
Thanks Karl!
Regards
Cor van Dooren
-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: vrijdag 12 maart 2010 8:36
To: Flash List
Subject: [Flashcoders] RegExp
Hello List
...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: vrijdag 12 maart 2010 8:36
To: Flash List
Subject: [Flashcoders] RegExp
Hello List,
A while back I remember someone asking about RegExp (regular
expressions).
I found this website. Now it is not flash based
Here's a great RegEx resource:
http://gskinner.com/RegExr/
- MM
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Hello List,
A while back I remember someone asking about RegExp (regular
expressions).
I found this website. Now it is not flash based, it is javascript,
but interesting none the less.
May give people hints on how to construct their own in AS or even PHP
for that matter.
I am new to lists
Hi list...
I have some input text box with a go button that is enabled or disabled based
on an Event.CHANGE for the TextInput. As someone types in a string, a go
button becomes enabled or disabled, but I want the *entire* text in the text
box to be considered, not just a matched substring.
Hi Michael,
Firstly, I'm not quite sure your expression is right - it says g
_or_ 1 or 2 or 3 as the first character, whereas your sample starts
with a g then a 1.
But anyway - what you need to do is to test for the beginning and
end of the string. In regular expressions, you do this with the
Mendelsohn, Michael wrote:
I want the *entire* text in the text box to be considered, not just a matched
substring. Is this possible?
Use ^ to lock to the begining of the string and $ to lock to the end of
the string, use both and it will not be allowed anything other than the
expression.
Thanks very much Ian and Henrik. The ^ and $ was exactly what I was looking
for.
Regards,
- Michael M.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Hi list...
I'm debating using a RegExp to search for a value in E4X, or do it by searching
the below data within CDATA. I think the RegEx would be cooler to use, making
for a smaller XML file, but I wonder if it would be faster to simply loop
through an array of these values. Anyone have any
You, sir, are a victim of premature optimization.
Write it the easy way. If it proves to be a bottleneck later, optimize it then.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Will do, sage advice.
- MM
Write it the easy way. If it proves to be a bottleneck later, optimize it
then.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Everybody thank you!
Jiri
Merrill, Jason wrote:
Seriously, just play with RegExr / Regex Buddy, get the cheat sheets:
Am now - love it! Can't I still be in awe? :)
Jason Merrill
Bank of America | Learning Performance Solutions Instructional
Technology Media
Learn about the
I would like some help on a regExp
I have a string and want to split it into the first character being a
||=|=|== the second part being an int.
so 100
would return
result[1] = ''
result[2] = 100
so 100
would return
result[1] = 'undefined'
result[2] = 100
Here is what I have so far, but it
Hi,
How about:
/([=]+)([0-9]+)/
Check out RegExr by Grant Skinner - it's lovely.
The problem with = and = is that there is look behind in the
regex controlled by these chars so the order of = seems to be important???
Glen
Jiri wrote:
I would like some help on a regExp
I
oops, forgot about the comparison operator being optional. New version:
/(((|)=?)|==)?(-?\d+)/
hot darn.
Dave
On Thu, Mar 5, 2009 at 10:44 AM, David Hershberger he...@zipzapplay.comwrote:
How's this?
/(((|)=?)|==)(-?\d+)/
Then the comparison operator is in result[1] and the number is in
Like Glen said, check out Grant's RegExr - it really helps this kind
of thing out. :-)
Ian
On Thu, Mar 5, 2009 at 6:51 PM, Merrill, Jason
jason.merr...@bankofamerica.com wrote:
/(((|)=?)|==)?(-?\d+)/
hot darn.
A side note. I'm so in awe at the people who understand and can write
Regular
Seriously, just play with RegExr / Regex Buddy, get the cheat sheets:
http://www.regexbuddy.com/
http://gskinner.com/RegExr/
http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/
Then spend some time dealing with Apache Mod Rewrite which will
stretch your regex muscles...
Seriously, just play with RegExr / Regex Buddy, get the cheat sheets:
Am now - love it! Can't I still be in awe? :)
Jason Merrill
Bank of America | Learning Performance Solutions Instructional
Technology Media
Learn about the Adobe Flash platform for rich media experiences - join
wow - i have no idea what that means at all
time to hit the books - thanks :)
On 4 Jul 2008, at 01:09, Claudius Ceteras wrote:
Hi,
is there a way of counting back from the end of the number and
inserting the comma (even without a regular expression)? if i
use the
g modifier in the regexp
hi again
i've been trying different things and it seems that the [^0] or [^\d]
is stopping it working. (I needed to use $1 rather than \1 to
reference the first group in the String.replace statement)
here is what i've got so far
var sYear:String = 1234567;
var pattern:RegExp =
Hi Allandt,
Have you found this tool already?
http://www.gskinner.com/blog/archives/2008/03/regexr_free_onl.html
It allows you to test your regex pattern expecially for AS
And you can find a cheatsheat on RegEx on www.ilovejackdaniels.com and
there is ofcourse alot on
hey that's great sid - thanks
a
On 4 Jul 2008, at 12:26, Sidney de Koning wrote:
Hi Allandt,
Have you found this tool already? http://www.gskinner.com/blog/
archives/2008/03/regexr_free_onl.html
It allows you to test your regex pattern expecially for AS
And you can find a cheatsheat on
Hi,
var sYear:String = 1234567;
var pattern:RegExp = /(\d\d\d)(?=(?:\d\d\d)*[^\d])/g;
sYear = sYear.replace(pattern, ,$1);
//traces 1234567
That's because [^\d] expects a non-digit after the number
Try this:
var sYear:String = The year when all happened was 1234567 indeed // :)
To get
To get this to also work with just the year you may replace [^\d] with
(?:[^\d]|$) which expects a non-digit or the end of the string
Or even better Replace [^\d] with \b which should also work.
regards
Claudius
___
Flashcoders mailing list
the \b boundary worked a treat - i'm just researching why it worked now
thanks for all your help guys
a
On 4 Jul 2008, at 13:17, Claudius Ceteras wrote:
To get this to also work with just the year you may replace [^\d]
with
(?:[^\d]|$) which expects a non-digit or the end of the string
the \b boundary worked a treat - i'm just researching why it
worked now
/(\d\d\d)(?=(?:\d\d\d)*\b)/g
Find all groups of three digits (\d\d\d) , which are followed by
positive lookahead: (?= )
0, 3, 6, 9, ... Digits, followed by a word boundary (?:\d\d\d)*\b
Word boundaries match
wow - that's really helpful - thanks a lot for your time claudius
best
a
On 4 Jul 2008, at 14:56, Claudius Ceteras wrote:
the \b boundary worked a treat - i'm just researching why it
worked now
/(\d\d\d)(?=(?:\d\d\d)*\b)/g
Find all groups of three digits (\d\d\d) , which are
Hi,
is there a way of counting back from the end of the number and
inserting the comma (even without a regular expression)? if i
use the
g modifier in the regexp (so var pattern:RegExp = /000/g;), it will
only pick up the first 000 (and every multiple thereafter)
instead of
hey
i am using regexp to inject commas into my years by searching for 000
and replacing with ,000 like this
var pattern:RegExp = /000/;
sYear = sYear.replace(pattern, ,000);
however, this approach will bug every multiple of 10,000 as there are
more zeros than the pattern expects.
is
Hi,
You can check out ascb (ActionScript Cook Book), a library with some useful
functions. In this case, the class NumberFormat, and the method format may
do the job.
http://www.rightactionscript.com/ascb/
Almost any formatNumber method you can find in many other libraries will
help you too,
thanks a lot :)
On 2 Jul 2008, at 15:24, Juan Pablo Califano wrote:
Hi,
You can check out ascb (ActionScript Cook Book), a library with
some useful
functions. In this case, the class NumberFormat, and the method
format may
do the job.
http://www.rightactionscript.com/ascb/
Almost any
48 matches
Mail list logo