Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I want to let users select multiple layers of folders.
Once they select a version folder (Folder name similar as: 1.0.0) I will continue to do next steps.
How can I match the format like 1.0.0?
You can use regular expressions:
folderName="1.2.3"; matchPattern="^[0-9]\.[0-9]\.[0-9]$"; # if regex match, execute the command after "&&" [[ $folderName =~ $matchPattern ]] && echo "Folder name matches pattern"
Add a comment
You may try the below command.
grep -Po '(?foldername)\d.\d.\d'
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.