sed 's/scarlet/red/g;s/ruby/red/g;s/puce/red/g' # most seds
==================================================nix file glob pattern START
So to match all files except "." and ".." safely you have to use
3 patterns (if you don't have filenames like ".a" you can leave
out the first):
.[!.]* .??* *
===============================================nix file glob END
(https|http|ftp|news)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*
==========================================http links END
[^a-zA-Z] -- anything else but a letter
[^0-9] --- anything else but a digit
==========================================digits , letters
Operators
m// 'Match' operator
s/// 'Substitute' operator
tr/// 'Translate' operator
# Special Characters
. Any single character escept newline n
b Between word and non-word chars, ie: /bcat/b/ matches "cat" but not "scat"
B NOT between word and non-word chars
w Word character
W Non-word character
d Digit
D Non-digit
s White-space
S Non-white-space
# Assertions (Position Definers)
^ Start of the string
$ End of the string
# Quantifiers (Numbers Of Characters)
n* Zero or more of 'n'
n+ One or more of 'n'
n? A possible 'n'
n{2} Exactly 2 of 'n'
n{2, } At least 2 (or more) of 'n'
n{2,4} From 2 to 4 of 'n'
# Groupings
() Parenthesis to group expressions
(n/sitebuilder/regex/images/1/a) Either 'n' or 'a'
Character Classes
[1-6] A number between 1 and 6
[c-h] A lower case character between c and h
[D-M] An upper case character between D and M
[^a-z] Absence of lower case character between a and z
[_a-zA-Z] An underscore or any letter of the alphabet
$mystring =~ s/^s*(.*?)s*$/$1/; Trim leading and trailing whitespace from $mystring
$mystring =~ tr/A-Z/a-z/; Convert $mystring to all lower case
$mystring =~ tr/a-z/A-Z/; Convert $mystring to all upper case
tr/a-zA-Z//s; Compress character runs, eg: bookkeeper -> bokeper
tr/a-zA-Z/ /cs; Convert non-alpha characters to a single space
# print first 10 lines of file (emulates behavior of "head")
sed 10q
# delete the first 10 lines of a file
sed '1,10d'
# delete ALL blank lines from a file (same as "grep '.' ")
sed '/^$/d' # method 1
sed '/./!d' # method 2
# remove most HTML tags (accommodates multiple-line tags)
sed -e :a -e 's/<[^>]*>//g;/ sed 's/foo/bar/g' filename # standard replace command
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
6 days ago
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!