^[19]+
199 mountains reach the skies.
^[19]+ will not match
mountains reach 199 skies.
Because the 1 or 9 needs to be at the beginning of the string to make the regexp match. Try removing the anchor an see what happens.
Using the $ at the end of your regexp anchors it to the end of the string.
skies.$
mountains reach the 199 skies.
[1-9].*$
mountains reach the 199 skies.
^.*(1.+9).*$
mountains reach the 199 skies.
Form a group around 1 anything 9 and anchor it to both ends of the string.
No comments:
Post a Comment