I'm trying to use find with the regex option. However my regular expression only captures the basename of the file. Is there a reference to the "directory find is currently in" I can use in my regular expression so that I don't have to account for it by means of a leading .*?
I'd like to find all of the files in my home folder on Linux (Ubuntu, in this case) that contain a match a particular regular expression. Is there a simple Unix command that I can use in order to do this?
For example, I'd like to find all of the files in my home folder that contain a match of the following regex (here, using Javascript-style notation): ((R|r)eading(T|t)est(D|d)ata)
Goodmorning,
I've some problem in using regular expression in a VIM syntax configuration file.
I've need to match a string as <<< some to match >>> so that it matches only some to match .
With standard regular expression i know that for this goal works fine the regex:
(?<=<{3}).*(?=>{3})
but in Vim syntax files this doesn't work.
What is the Linux command-line command that can identify such files?
AFAIK the find command (or grep) can only match a specific string inside the text file. But I want to match whole contents, i.e. I want to see which files match regular expression \0+, ignoring the line end character(s). Maybe the find .
Hi all,
Accounting to gnu/sed manual,
http://www.gnu.org/software/sed/manu...ar-Expressions
*
Matches a sequence of zero or more instances of matches for the preceding regular expression, which must be an ordinary character, a special character preceded by \, a ., a grouped regexp (see below), or a bracket expression.
The man page for GNU's less utility says the following about searching:
/pattern
Search forward in the file for the N-th line containing the pattern. N
defaults to 1.
Hi all
I have a list of file names in array. But this file names are not exact. so i want to search whether a file exists or not using regular expression.
code snippet:
Code:
if [ -f "*EQST*" ];
then
echo "File exists"
else
echo "File does not exits"
fi
over here "*EQST*" should be treated as a regular expression.
TweetGrep is one of the most important tools for a shell user. When it comes to retrieving required data from a bulk of text, grep is your best bet. Its very flexible, powerful and as I came to know today, has an interesting story too.
It all started a long time ago.
Here is the question...
Create a new script, sub2, taking three parameters...
1.) the string to be replaced
2.) the string with which to replace it
3.) the name of the file in which to make the substitution
...that treats the string to be replaced as plain text instead of as a regular expression.
Hint 1: Try to get the string to be replaced into a shell variable (e.g., $target).