Solved

REGEXP for URL not working

Posted on 2008-10-22
3
483 Views
Last Modified: 2008-12-11
Hi Guys,

I am trying to check a URL however its not working,

I am only concerned that the start is a protocol ie http https or ftp.

Here is what I got


var pattern:RegExp = new RegExp("/^(ftp|http|https):\/\/");
			trace("testing " + event.currentTarget.text);
			trace(pattern.test(event.currentTarget.text));

Open in new window

0
Comment
Question by:jdunneuk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Accepted Solution

by:
ngiamouris earned 125 total points
ID: 22775891
try:
var pattern:RegExp = new RegExp("^(ftp|http|https):\/\/");
0
 
LVL 3

Author Comment

by:jdunneuk
ID: 22775958
thanks ngiamouris
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 22868110
Is this solved?
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question