Regex 101: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Line 6: Line 6:
echo "A" |grep "^A"  
echo "A" |grep "^A"  
echo "AAAAAAAAAAA" |grep "^A"  
echo "AAAAAAAAAAA" |grep "^A"  
</syntaxhighlight>
=Starts with followed by=
<syntaxhighlight lang="bash">
echo "AAAAAAAAAAAB" |grep "^A*B"
</syntaxhighlight>
</syntaxhighlight>

Revision as of 02:39, 11 April 2021

Testing

echo "My stuff" | grep "^My"

Examples

Starts with

echo "A" |grep "^A" 
echo "AAAAAAAAAAA" |grep "^A"

Starts with followed by

echo "AAAAAAAAAAAB" |grep "^A*B"