User Tools

Site Tools


computer_regular_expressions

If you want to send us your comments, please do so. Thanks
More on comments


Regular Expressions

Explanation
Overview
PCRE2 Perl-compatible Regular Expressions
Tester

Syntax

PCRE1) pattern man page
man grep and info grep info pages for regular expression explanation and predefined named classes of characters like [:alnum:]
Check if PCRE2_UTF is set (echo $PCRE2_UTF) to check if ascii or UTF-8 syntax must be used. Source

CodeExplanation
?Matches the previous token between zero and one times
{0,1}Matches the previous token between zero and one times
*Matches the previous token between zero and unlimited times
{0,}Matches the previous token between zero and unlimited times
{32}Matches the previous token exactly 32 times
+Matches the previous token between one and unlimited times
{1,}Matches the previous token between one and unlimited times
[0-9T:.+-]Match a single character which may be: any digit, 'T' (case sensitive), ':', '.', '+' or a '-'
[[:something valid:]]A character class. See man grep for valid entries like [:something valid:]
[._[:alnum:]-]Match a single character which may be: '.', '_', '-', [:alnum:]. The '-' can not be placed at any position
A stringMatches an exact string. E.g. the sentence has to match
$Asserts position at the end of a line. Use when the end of the regex line coincides with the end of the line
'^$'Matches an empty line, which consists of zero characters
(?# some text or a commented out rule)Comment. A comment is inert, void, for the pattern matching behavior
#Comment if unescaped and if the PCRE2_EXTENDED or PCRE2_EXTENDED_MORE option is set. 0x0a (the default newline) terminates the comment
'left:[^;]*'This regex matches the substring starting with left: and captures everything after it until the next semicolon (;). The [^;]* part matches any characters that are not a semicolon
\*\*[ ]*Match ** followed by a undefined number of spaces

Set PCRE2_EXTENDED

T.b.d.

Tools

check-regexp AAB$ "AAB DER GTY HUE AAB FERG GYT AAB"

RegexBuddy
GNU.org on Regular Expressions


Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy

RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2026 Webevaluation.nl and the authors
Changes reserved.

1)
Perl Compatible Regular Expressions
computer_regular_expressions.txt · Last modified: by wim