You don't really need a regex for that. You can use (url.indexOf('/tec') != -1).
I believe he is trying to identify a url ending in /tec in a text.
In this case a usable regexp could be:
var pattern1:RegExp = /(http:\/\/[a-zA-Z\.\/]\/tec)[\s|$]/i;
That may be too strict:
- does not allow https
- does not allow numbers, dashes, or any of a number of other valid characters in URLs (including, with IDN, in domain names)
The original poster may not need these, but a regex that's neither too restrictive nor too permissive is not easy.
Tanks for the input, I think I'll go for regex way, and try to make it more permissive. But first I need to refresh my knowledge on regex, as I did not use them in actionscript before.Do you know some good tutorial on this?
As a basic reference, I always use this site:
http://www.regular-expressions.info/ . I haven't gone through their
tutorial, but I find the reference very useful and well organized, and
ActionScript regexes support most of the standard basic and advanced
syntax on that page.
I have a look over it. It was helpful.