SEO Forums
 
 Hot news
 Seo forums
 Discussions
 Meet people
 Games server
 Web directory
 Social network




 
 

Seo forums

 
SEO general
SEO scripts
SEO tools
 
 

Google

 
News
Optimization
Pagerank
Dance
Adsense
Adwords
 
 

Yahoo!

 
News
Optimization
 
 

Microsoft

 
News
Optimization
 
 

Marketing

 
Coop network
Promotion
Affiliations
Domain names
Link popularity
Link exchange
Directories
Buy & sell
Services
Freebies
 
 

Development

 
Programming
Server issues
Multimedia
Javascript
Databases
Security
HTML
AJAX
CSS
PHP
 
 

Other

 
Search engines
Traffic ranking
Robot spiders
E-Commerce
Site reviews
Keywords
 
 

Misc.

 
Welcome
Suggestions
Miscellaneous
 
 
 
Register
Membership
 
Links
 
Help
About
 
 
















                                          

User     Password   remember     (register)  ?

Regular expression to shorten URL


Back to forum


moderator    (2006-12-18)

moderator

 
Regular expression to shorten URL

Hello to all...

I have a small code problem, looking for a regular expression that would shorten URL changed in links (ie. http://www.ficgs.com/looooooooooooongurl.html would appear http://www.ficgs.com/looo...url.html .. Here is my regular expression :

$url = preg_replace("#([\n ])?([hftp]+)://([a-z0-9-=_%\#$~%&;?./]+)#i", '\1<a href="\2://\3" target="_blank">\2://\3</a>', $url);


Thanks in advance :)


ficgs
Regular expression to shorten URL

 RE: Tomcat 5.5 Regular Expression as servlet-mapping url-pattern
www.mail-archive.com/users@tomcat.apache.org/msg18701.html

 shorten a string created from regular expression : php
www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_24188618.html

 Gallery2:URL Rewrite - Gallery Codex
codex.gallery2.org/Gallery2:URL_Rewrite

 Wikipedia:AutoWikiBrowser/Regular expression - Wikipedia, the free encyclopedia
en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Regular_expression

 Noah Coad : Amazon Short URL RegEx
blogs.msdn.com/noahc/archive/2007/05/22/amazon-short-url-regex.aspx

  Resolve and shorten URLs in C#
madskristensen.net/post/Resolve-and-shorten-URLs-in-Csharp.aspx

 Hoe doe ik Short url rewrite rules met htaccess - Uitgelegd
www.leerwiki.nl/Hoe_doe_ik_Short_url_rewrite_rules_met_htaccess

 Django | URL dispatcher | Django Documentation
docs.djangoproject.com/en/dev/topics/http/urls/

 Synected Plugin / Blurbia / Built on Wordpress
www.blurbia.com/plugins/synected/

 Daring Fireball: How to Block the DiggBar
daringfireball.net/2009/04/how_to_block_the_diggbar

 The Power of Regular Expression: use in notepad++
www.slideshare.net/anjesh/the-power-of-regular-expression-use-in-notepad

  Regular Expression Test Tool - Snippet IT
www.snippetit.com/2009/02/regular-expression-test-tool/

 Tomcat 5.5 Regular Expression as servlet-mapping url-pattern
mail-archives.apache.org/mod_mbox/tomcat-users/200610.mbox/%3C86aa493a0610270634w6d005cf9l916a3dd570e7d8b0@mail.gmail.com%3E

 section_in_section has a regular expression that is incorrect | drupal.org
drupal.org/node/14320

 Regular Expressions
www.astahost.com/info.php/Regular-Expressions_t19111.html

 Java and Regular Expressions - Tutorial
www.vogella.de/articles/JavaRegularExpressions/article.html

 Creating a short url service with php and mysql--tutorial.jcwcn.com
tutorial.jcwcn.com/Web-Design/PHP/Link-Indexing/2009-04-17/13587.html

 Regex Examples - Regex Guru
www.regexguru.com/category/regex-examples/

 .htaccess tricks and tips.. part two: url rewriting with mod rewrite.
corz.org/serv/tricks/htaccess2.php

  Sitescooper: scoop websites onto your PalmPilot
sitescooper.org/

 Regular expression to shorten parsed links in an article - SitePoint Forums
www.sitepoint.com/forums/showthread.php?t=447770

 YOV408 Programming Resources - Regular Expressions tutorials
www.yov408.com/html/tutorials.php?s=53

 Unix Manuals - Regular Expressions Reference
www.unix-manuals.com/refs/regex/regex.htm

 Regular Expression Basics | evolt.org
www.evolt.org/node/22700

 Manual talk:Short URL/wiki/Page title -- no root access - MediaWiki
www.mediawiki.org/wiki/Manual_talk:Short_URL/wiki/Page_title_--_no_root_access

 Regular Expression Examples
www.regular-expressions.info/examples.html

  Regular expression - dot problem!
mail.python.org/pipermail/python-list/2006-June/558912.html

 New JMX client for batch for V2.2 (The Shorten Spot)
blogs.oracle.com/theshortenspot/2009/03/new_jmx_client_for_batch_for_v.html

 DZone Snippets: Store, sort and share source code, with tag goodness
snippets.dzone.com/2

  regular expression to restrict number of consecutive characters - bytes
bytes.com/groups/javascript/722519-regular-expression-restrict-number-consecutive-characters

 Abbreviate URLs with mod_rewrite - url abbreviation uri mod rewrite
www.websiteoptimization.com/speed/tweak/abbreviate/

 Bluehost Support Center
helpdesk.bluehost.com/index.php/kb/article/000198



Response  
   
 
 
 
 

 
 
 

Guest name   (optional)       Register for more options.







 

FICGS message




SEO forums and chat - Search engines optimization



 
Please download Flash player.
July 04, 2009

 

Facebook Myspace Twitter Google Technorati Stumble upon Delicious Digg Yahoo buzz Wikio Furl Reddit Linkedin Squidoo Newsvine Yahoo My Web Blogmarks Comments Blinklist Email

Write upside down !
(works with Facebook, MySpace, Youtube, MSN, Yahoo, Bebo, Hi5...)







FICGS is also a Free Internet Correspondence Games Server.

Here you can play Chess, Go & Poker Texas Holdem online for free in rated class tournaments and a unique world championship.




Feel free to link to FICGS :