Monthly Archives: October 2009

regular expressions for url / html parsing

/(?:=)[^&]*/g /.*?(?=\?)|.*/ /[\w_.-]*?(?=\?)|[\w_.-]*$/ /[\w]*?(?=\?)|[\w]*$/ /([\w_-]*)\.(\w*)?(?=\?)/ /(?:\w*:\/\/)?((?:[\w-_]*\.?)+:?\d*(?:\/?[\w-_.]+\/?)*)[\?]?[\&]?([\w- _]*)?=?([\/\w-_\?\)%\.\(\*\[\]\^<>\\]*)?[\&]?([\w-_]*)?=?([\/\w-_\?\)% \.\(\*\[\]\^<>\\]*)?[\&]?([\w-_]*)?=?([\/\w-_\?\)%\.\(\*\[\]\^<>\\]*)?[\&] ?([\w-_]*)?=?([\/\w-_\?\)%\.\(\*\[\]\^<>\\]*)?/ /<\s*h4[^>]*>(.*?)<\s*/\s*h4>/g /<(.|\n)*?>/g /<\s*\w.*?>/g /<\s*\/\s*\w\s*.*?>|<\s*br\s*>/g /<\s*div.*?>/g /<\s*\/\s*div\s*.*?>/g /<\s*\/?\s*span\s*.*?>/g /<\s*\w*\s*style.*?>/g /<\s*\w*\s*href\s*=\s*"?\s*([\w\s%#\/\.;:_-]*)\s*"?.*?>/g http://www.pagecolumn.com/tool/all_about_html_tags.htm http://www.pagecolumn.com/tool/url_regex.htm

Posted in Code Snippets | Leave a comment