| ^ REGEX METACHARS REGEX MODIFIERS
&& ^ string begin /i case insens.
|| $ str. end (before \n) /m line based ^$
.. ... + one or more /s . includes \n
?: * zero or more /x ign. wh.space
= += -= *= etc. ? zero or one /g global
, => {3,7} repeat in range
list ops () capture REGEX CHARCLASSES
not (?:) no capture . == [^\n]
and [] character class \s == [\x20\f\t\r\n]
or xor | alternation \w == [A-Za-z0-9_]
\b word boundary \d == [0-9]
\z string end \S, \W and \D negate
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
Useful Perl Snippets
$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
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...
1 week 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 !!!!