![]() ![]() Now it's time for me to share some examples of how you can use find with regex. ![]() regular_expression is where you will be using tokens to express the file pattern you are looking for.Now, Let's have a look at the basic syntax of using find with regex: find -regex Means ad will get you aed, azd but not abd or acd. Generally, it is sued to specify the starting point of search but can also be used to negate the content when used inside the square brackets. This means ad will match abd or acd, but not the abcd. It will get a positive result of any character used in a string inside the square brackets. So the ca*t will find get you ct, cat, caat etc. This means the preceding character can be found 0 or more times. It eliminates the effect of special characters such as the (.) will indicate to period effect but when used a.b it will only search for strings as a.b So a.b will match strings such as acb, aeb and abb but won't match accb or ab It gets you a match for any character once (except a new line). So let's have a look at some of the most basic and widely used tokens which I'll be using with the find command: Token Tokens are nothing but special characters to search for specified patterns. You can enable the beast mode in the find command by using regular expression (regex) for searching.īut before jumping to the examples part, it is crucial to know some basic regex tokens and syntax. The find command is a powerhouse for searching files based on a number of criteria. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |