RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Fix broken URLs from plain text document
Expression
https?://[^<>() ]+([ ](((?!https?://)[^<>() ])+)(?=[^<>() ]*[?!=%&-+/])[^<>() ]*)*
Description
If you are searching a text document for 'full' URLs and something happened during the printing process to break the URL into a space, then this will fix your problem, it will also not latch onto another URL, or a single word containing a period or comma after it. Modified to ignore < >, which can cause HTML hell. Note: No characters are escaped
Matches
http://translate.google.com/translate?u=http%3A%2F%2Fnews.google.com%2Fne ws%2Furl%3Fsa%3Dt%26fd%3DR%26usg%3DAFQjCNEcocJHIN3DVPBnCnNNP78 7_q4haQ%26url%3Dhttp%3A%2F%2Fe.jmrb.com%2Fm%2F2011%2F04%2F15% 2F01%2Fm_270933.shtml&tl=en&sl=zh
Non-Matches
This page is http://www.regxlib.com/%28A%285wLWZYSyc9SR-ZhD9g70GaqKVwkjE_3sJETP5Vey2xQAfP9PrnYifOvfp9wrstlpLiWBo3FS-OZoHxbTmkwtZgPXergF3RpRmMI_X8zmp9u0ZaZnJr1Wzg8I1FndlF9a_4vPO6vWN8AE6DUAug9EfnMiZQWkeZk3ds2oh9FuKuv8URnUC5ejmHWF5jlEres10%29%29/UserPatterns.aspx
Author Rating: Not yet rated. Ryan Ward
Source Ryan Ward
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials