The problem is:
I am trying to filter an arraycollection(labels) against the text. Using a
filter function and in there I am trying to use RegExp.

More specifically, whenever I enter a text like 12.0, it returns me results
with "-" character as well like 12-0 etc.

So I want that whenever I enter "." in my search, it should only return me
results with "." and NOT "-" and vice-versa.

Thanks,
Manu.


Guy Morton wrote:
> 
> \. will match a literal full stop.
> \\ will match a backslash.
> - will match normally without being escaped, so long as it's not in  
> the context of a character range (ie [a-z] means match any character  
> from a to z, to match a, - or z you'd do [a\-z])
> 
> Guy
> 
> On 09/02/2009, at 11:24 AM, Sam Lai wrote:
> 
>> Escape them by doing \. instead of .
>>
>> You might also have to escape the escape character too, i.e. \\.  
>> instead.
>>
>> 2009/2/9 Manu Dhanda <[email protected]>:
>> >
>> > So, how can I exactly match "." OR "-" character correctly?
>> >
>> >
>> > Guy Morton wrote:
>> >>
>> >> In regexp syntax, "." means "match any character"
>> >>
>> >> On 06/02/2009, at 1:37 PM, Manu Dhanda wrote:
>> >>
>> >>>
>> >>> Hi Guyz,
>> >>> I am having this particular issue and at the moment not able to  
>> come
>> >>> out
>> >>> with a solution.
>> >>> Any help or direction to solution would be great.
>> >>>
>> >>> var someStr:String = "12-88";
>> >>> var str:String = "12.88";
>> >>> var bool:Boolean = someStr.match(new RegExp("str",'i');
>> >>>
>> >>> Here, the match returns true.
>> >>> I don't understand why "-" is being matched to "." returning TRUE.
>> >>>
>> >>> -Manu.
>> >>> --
>> >>> View this message in context:
>> >>> http://www.nabble.com/Flex-RegExp-issues-tp21865562p21865562.html
>> >>> Sent from the FlexCoders mailing list archive at Nabble.com.
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Flex-RegExp-issues-tp21865562p21905244.html
>> > Sent from the FlexCoders mailing list archive at Nabble.com.
>> >
>> >
>> >
>> > ------------------------------------
>> >
>> > --
>> > Flexcoders Mailing List
>> > FAQ: http://groups.yahoo.com/group/flexcoders/files/ 
>> flexcodersFAQ.txt
>> > Alternative FAQ location:
>> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
>> > Search Archives:
>> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo 
>> ! Groups Links
>> >
>> >
>> >
>> >
>>
>> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Flex-RegExp-issues-tp21865562p21905504.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to