Category Archives: regex

regex: backreferences

ShareBackreferences Perhaps the most powerful element of the regular expression syntax, backreferences allow you to load the results of a matched pattern into a buffer and then reuse it later in the expression. In a previous example, we used two … Continue reading

Posted in regex | Tagged , , | Leave a comment

validate http:// or https:// using regex

Share You can validate http:// or https:// using the methods below: $link = “http://site.com”;  or $link = “https://site.com”; Example: My values would be either of the two, with or without “s”. Method 1: echo preg_match(“^(http(s?))://^”, $link); I prefer this method … Continue reading

Posted in regex | Tagged , , , | Leave a comment

regex

ShareJust wanted to share regex reference site. You can check it here http://www.grymoire.com/Unix/Regular.html for more details. What is a Regular Expression? A regular expression is a set of characters that specify a pattern. The term “regular” has nothing to do … Continue reading

Posted in regex | Tagged , , , | 1 Comment