Regex 101: Difference between revisions
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
echo "AAAAAAAAAAA" |grep "^A" | echo "AAAAAAAAAAA" |grep "^A" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==Starts with and Ends With== | ==Starts with any number of As and Ends With== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
echo "AAAAAAAAAAAB" |grep "^A*B$ | echo "AAAAAAAAAAAB" |grep "^A*B$ |
Revision as of 02:43, 11 April 2021
Testing
echo "My stuff" | grep "^My"
Examples
Starts with
echo "A" |grep "^A"
echo "AAAAAAAAAAA" |grep "^A"
Starts with any number of As and Ends With
echo "AAAAAAAAAAAB" |grep "^A*B$
Starts with followed by
echo "AAAAAAAAAAAB" |grep "^A*B"