Regular Expression | naveenOS https://www.naveenos.com How may I help you - E-Commerce | Full-Stack Developer Sun, 17 Jul 2016 13:19:48 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 How to replace string in parentheses using regex https://www.naveenos.com/2012/06/how-to-replace-string-in-parentheses-using-regex https://www.naveenos.com/2012/06/how-to-replace-string-in-parentheses-using-regex#respond Wed, 27 Jun 2012 15:05:01 +0000 http://www.naveenos.com/?p=525 PHP, Java and other languages provide replace all functionality to replace any character by any specific character. But REGEX is best method to replace or remove any specific value using pattern. Suppose, we have input string is $xyz = "This is my best (friend)"; and we want to remove words from “()”. So it so […]

The post How to replace string in parentheses using regex first appeared on naveenOS.]]>
https://www.naveenos.com/2012/06/how-to-replace-string-in-parentheses-using-regex/feed 0
Javascipt: how to use nl2br function https://www.naveenos.com/2011/03/javascipt-use-nl2br-function https://www.naveenos.com/2011/03/javascipt-use-nl2br-function#respond Thu, 03 Mar 2011 07:43:26 +0000 http://naveenos.com/?p=335 In php we have a function to replace nl2br means new line to break format. but when we need this functionality in our javascript code then what we do? We can do by simply manner: function nl2br(value) { return value.replace(/\n, ""); } Above function will return the converted ‘\n’ to ‘‘. But above function has […]

The post Javascipt: how to use nl2br function first appeared on naveenOS.]]>
https://www.naveenos.com/2011/03/javascipt-use-nl2br-function/feed 0
PHP: Regular expression to make linkable url in string https://www.naveenos.com/2011/02/php-regular-expression-to-make-linkable-url-in-string https://www.naveenos.com/2011/02/php-regular-expression-to-make-linkable-url-in-string#comments Wed, 16 Feb 2011 11:25:05 +0000 http://naveenos.com/?p=323 Are you looking for a regular expression to make clickable url in the string? Yes!, you will get your solutions here: echo preg_replace("/http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "$0", $string); If you want to open url in new tab then : echo preg_replace("/http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "$0", $string); Tweet This Post

The post PHP: Regular expression to make linkable url in string first appeared on naveenOS.]]>
https://www.naveenos.com/2011/02/php-regular-expression-to-make-linkable-url-in-string/feed 1