Regular Expressions (also called RegEx or RegExp) are a powerful way to analyze text. Php regex can use caret (^) for matching from beginning of string and dollar ($) for end of line. We define some PCRE regex functions. The regex matches the literal string "3.2" as long as it is found at the end of the string (because the regex ends with ' $ '). You have to use php string function like below example. :) Added the "