4/15/2023 0 Comments Grep usage perlSo in output, it will not print ‘hello’ and ‘bye’. So we have created ‘^*$’ this as a regular expression that will accept only numbers or digit. In the next line, we are using grep() function to identified the integers in the string. First, we are creating a string that holds some integer value as well. Let’s see one practice example to understand the working of grep() function in Perl in more detail see below Įxample: # Your code = ('100', '200', 'Hello', = grep(/^*$/, this example, we are trying to find out only numbers or digit from the string array that we are creating. This can be a single value or a multiple value that can be returned. If the value satisfies the regular expression then it will be kept as the return value from the array, if the value does not matches the regular expression then it will be discard.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |