0
Why cant u just use gr instead of ^gr
In regular expression characters
2 Answers
+ 2
<p> Kevin</p>, in your example there won't be a match because ^amasa$ means that the whole string has to be amasa and there can't be anything before (^) or after ($) that. ^ and $ refer to the whole string, not to the regex pattern. You could match the string ImamasaHere with a pattern like ^Im(.*?)re$ .
gr will match a string if gr is anywhere in the string:
"great" <= match
"not great" <= match
^gr means that the string has to begin with gr:
"great" <= match
"not great" <= no match
+ 1
^ symbol, indicate that start. and $ as the end.
lets say i have a pattern "amasa", with string " ImamasaHere". the result will be the same using search.
i want only "amasa"... so... the pattern is " ^amasaquot;.
i hope its help