在使用Timer时遇到问题(Having problem in using Timer)
我在Flex中使用计时器功能
但它给我一个运行时错误。
我的代码如下所示:
import flash.utils.Timer; public function fnname():void { if(x==150) { while (y==0) { x ++; Timer(100); } } }
我得到的错误是:错误#1034:类型强制失败:无法将100转换为flash.utils.Timer。
I am using a timer function in Flex
but it gives me a run time error.
my code looks like this:
import flash.utils.Timer; public function fnname():void { if(x==150) { while (y==0) { x ++; Timer(100); } } }
the error i get is: Error #1034: Type Coercion failed: cannot convert 100 to flash.utils.Timer.
原文:https://stackoverflow.com/questions/1401543
最满意答案
看起来你应该把每个部分接踵而至:
^([MTWF]|Th)+ \d\d:\d\d([AP]M)? - \d\d:\d\d([AP]M)?$ |----------| |---------------| |---------------| ^ ^ ^ | | part 3: same as part 2 part 1: match one of these: | - "M", "T", "W", or "F" | - "Th" | part 2: match two digits, followed by a colon, followed by another two digits, then possible either "A" or "P" followed by "M"
开头的“^”和结尾的“$”是确保该行没有任何其他文本。
如果你只关心匹配的有效时间(而不是任何两位数字的时间),你可以做一些更有趣的事情,例如:
((1?\d|2[0-3]):[0-5]\d|(1[0-2]|\d):[0-5]\d[AP]M)
It looks like you should just put each part one after another:
^([MTWF]|Th)+ \d\d:\d\d([AP]M)? - \d\d:\d\d([AP]M)?$ |----------| |---------------| |---------------| ^ ^ ^ | | part 3: same as part 2 part 1: match one of these: | - "M", "T", "W", or "F" | - "Th" | part 2: match two digits, followed by a colon, followed by another two digits, then possible either "A" or "P" followed by "M"
The "^" at the beginning and the "$" at the end are to make sure the line doesn't have any other text.
If you care about only matching valid times (as opposed to any two digits for the hours), you can do something fancier, like this:
((1?\d|2[0-3]):[0-5]\d|(1[0-2]|\d):[0-5]\d[AP]M)
相关问答
更多-
用通配符匹配字符串(Matching strings with wildcard)[2023-07-07]
只是FYI,你可以使用VB.NET Like-Operator : string text = "x is not the same as X and yz not the same as YZ"; bool contains = LikeOperator.LikeString(text,"*X*YZ*", Microsoft.VisualBasic.CompareMethod.Binary); 如果您想忽略大小写,请使用CompareMethod.Text 。 您需要using Microsoft. ... -
近似字符串匹配(Approximate string matching)[2023-04-03]
您可以使用各种字符串距离度量。 我会推荐Jaro-Winkler 。 与编辑距离不同,比较的结果是以离散单位编辑的,JW会给你一个0-1的分数。 它特别适用于专有名称。 也看看这个漂亮的教程和这个SO问题。 我没有使用过C#,但这里有一些我在网上找到的JW的实现: Impl 1 (如果您查看文件列表,它们也有DOT NET版本) Impl 2 如果你想做一些更复杂的匹配,你可以尝试对公司名称进行一些自定义标准化处理,例如ltd/limited, inc/incorporated, corp/corporat ... -
字符串匹配/ *和* /(String Matching for /* and */)[2023-02-16]
m{^/\*.*\*/$} 将匹配/*作为前两个字符和*/作为最后两个字符的行。 m{^/\*.*\*/$} will match lines that have /* as their first two characters and */ as their last two. -
Python中的字符串匹配(String matching in Python)[2023-08-05]
根据消息来源 ,这是一个 快速搜索/计数实施,基于Boyer-Moore和horspool之间的混合,并在顶部添加更多的铃声和哨音。 有关更多背景信息,请参阅: http : //effbot.org/zone/stringlib.htm 这篇文章非常值得一读! Per the sources, it's a fast search/count implementation, based on a mix between boyer-moore and horspool, with a few more b ... -
复合串匹配(Compound String Matching)[2023-07-11]
看起来你应该把每个部分接踵而至: ^([MTWF]|Th)+ \d\d:\d\d([AP]M)? - \d\d:\d\d([AP]M)?$ |----------| |---------------| |---------------| ^ ^ ^ | | part 3: same as part 2 part 1: match one of these: | - "M ... -
字符串匹配(String Matching)[2024-01-05]
匹配"///RT///"和"///RATE///" 。 I don't know it will work every time or not.But I have tried this and it works right now in this string matching. I want to know whether this is ok or not,please give me suggestion. str1 = str1.Insert(0, "///"); str1=str1.Insert ... -
字符串匹配实现(String matching implementation)[2023-07-02]
在while循环中尝试pattLoc < (int)strlen(patt) 。 当pattLoc == 2 ,循环将停止,因此你要避免将"my"的'\0'与' ' "hello my name is pala" ' ' "hello my name is pala" ,将pattloc设置为0并return false 。 或者更好,使用字符串substr 。 Try pattLoc < (int)strlen(patt) in your while loop. Loop will stop when p ... -
Lucene的基本设计使用精确的字符串匹配,或使用Analyzer定义等效字符串。 分析器将文本分解为可索引的标记。 在此过程中,它可以整理等效的字符串(例如大写和小写,词干字符串,删除变音符号等)。生成的标记作为字典存储在索引中,并在文档中存储标记的发布列表。 因此,您可以构建和使用Lucene索引,而无需使用字符串匹配算法(如KMP)。 但是, FuzzyQuery和WildCardQuery使用类似的东西,首先搜索匹配的术语,然后使用它们进行完全匹配。 请参阅Robert Muir关于Automato ...
-
找到字符串匹配位置?(Find string matching position?)[2023-10-20]
您可以从字符串的结尾开始,然后以伪代码向后返回: char[] str = input.toCharArray() for i = str.length-1 down to 1: if str[i] is lowercase: if toLowerCase(str[i-1]) == str[i] and str[i-1] is uppercase: return i-1 return -1 // means no match is found Java代码: ... -
.retteb时代seirt xiferp,drawkcab daer uoy fI 认真。 后缀尝试允许您从字符串的开始处进行遍历。 .retteb era seirt xiferp ,drawkcab daer uoy fI Seriously. Suffix tries allow you to traverse from the beginning of a string.