I do have a shell file where I call many unix commands . I would like to add a regular expression step in that shell file, where a text file, say Test.txt has to be openned and all the :'s should be replaced.
Basically apply the follwoing regular expression:
Code:
:%s/://g
to that particular text file, which is generated from a previous command in that shell script.
Please let me know
How do you do grouping in grep? Here's how I tried it at first:
Code:
egrep qualit(y|ies) /usr/share/dict/words
-bash: syntax error near unexpected token `('
I'm using GNUgrep, and I found this on their site. grep regular expression syntax
Quote:
Grouping is performed with backslashes followed by parentheses \(, \).
I am trying to print out sentences that meets a regular expression in awk (Im open to using other tools, too).
I got the regular expression I want to use,
Code:
"([^)(]\+ [0-9]\{4\})"
from user ripat in a grep forum. Unfortunately with grep I couldn't print only the sentence.
I recently got into a friendly argument with Ghoti about what constitutes a regular expression in the comments to my answer to this question. I claimed that the following is a regular expression:
`[Rr]eading[Tt]est[Dd]ata`
Ghoti disagreed, claiming it is a file glob instead.
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.
Using grep (or some other utility), is it possible to find all matches of a regular expression in a folder (searching the text of each file?) I want to find every match of the regular expression zenity within a specific folder, so that I can find the file that contains the string zenity.
TweetAlmost everyone of us would have made the mistake of incorrectly typing “sl” or “LS” instead of a simple “ls”. Seriously! how difficult could it be to type those two words? But we keep making the same mistake over and over. In order to correct this problem, there is a wonderful program name “sl”.
The following command will tar all "dot" files and folders:
tar -zcvf dotfiles.tar.gz .??*
I am familiar with regular expressions, but I don't understand how to interpret .??*. I executed ls .??* and tree .??* and looked at the files which were listed. Why does this regular expression include all files within folders starting with . for example?
I have an XML file, the file is made up of one line.
What I am trying to do is extract the "finalNumber" attribute value from the file via Putty. Rather than having to download a copy and search using notepad++.
I've built up a regular expression that I've tested on an On-line Tool, and tried using it within a sed command to duplicate grep functionality.