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.
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.
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?
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 \(, \).
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.
How do I combine something like query-replace with a regular expression search-and-replace that in part reuses the search result?
In my case, how to transform
The programmers are "sort of" confident that the subroutines "load_students" and "compute_student_grade" are without bugs.
into
The programmers are "sort of" confident that the subroutines \texttt{load_students} and \texttt{comput
To match a word one can use
\v(\w+)
From the vim help :h \w:
\w word character: [0-9A-Za-z_]
This works exactly as described in the manual. However, I want to
match words that contain characters beyond a-z, e.g.
prästgården.
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.
When it comes to PHP, there is really on one true Regular Expression (Regex) standard to use. It is called PCRE (Perl-Compatible Regular Expressions). You might not even know that you were using PCRE, but chances are that you were. … [ Continue ]