html - Actionscript 3.0 Reg Exp Find first URL, Ignore Email -


I've got some code where I have a loop with string. Search () to parse a string of HTML Its purpose is to find any valid URL and to properly engage everyone with the HREF tag while ignoring anything like email address. The problem is how can I modify the regular expression, it either brings back or highlighted the part of the email address after the @ sign or it ignores or ignores everything.

An example string will be:

" Weisglegrace: "

Where weaselgrease.weasel.grs' will be identified as a proper URL and ignore 'weaselgrease@weasel.grs' will be given.

Do I currently have the code / ([fh] t {1,2} ps ?: \ / \ /)? [\ w -] + \. \ w {2,4} /

I know that this is not simple, but there is no need to be complicated yet. / p>

I have tried conditionally and without any effort I can be remembered, but my search and even people playing with me have not brought me closer.

In the end I do the following:
Identify the symbol of a valid URL string - If it is an email then ignore it
It has only one IP address (no pre-paid http: // and no trailing slash)

But I will be happy with just one sign of help, what I need to do to ignore the email address.

Without proper protocol (i.e. http, https, FTP) can not be valid because its This means that almost all of . (dot) contains a valid URL.

So there is no way to properly check whether the URL or the email is if you do not use the protocol. Example:

End of sentence. New sentence - & gt; Sentences New is a valid URL in your case weaselgrease@weasel.grs - & gt; Everything is ignored before @ and weasel.grs valid url

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -