Home » , » Regex Gramatikal (Kamus)

Regex Gramatikal (Kamus)

Written By SBlog on Tuesday, February 5, 2019 | February 05, 2019

Kesulitan memahami regex kita prlu namanya kamus untuk membantu menerjemahkan fungsi regex. Berikut ini beberapa karakter yang digunakan dalam penulisan regex.

RegexDescription
\dMatches any decimal digit; this is equivalent to the class [0-9]
\DMatches any non-digit character; this is equivalent to the class [^0-9].
\sMatches any whitespace character; this is equivalent to the class [ \t\n\r\f\v].
\SMatches any non-whitespace character; this is equivalent to the class [^ \t\n\r\f\v].
\wMatches any alphanumeric character; this is equivalent to the class [a-zA-Z0-9_].
\WMatches any non-alphanumeric character; this is equivalent to the class [^a-zA-Z0-9_].
\ZMatches only at end of string
[..]Match single character in brackets
[^..]Match any single character not in brackets
.Match any character except newline
$Match the end of the string
*Match 0 or more repetitions
+1 or more repetitions
{m}Exactly m copies of the previous RE should be matched.
|Match A or B. A|B
?0 or 1 repetitions of the preceding RE
[a-z]Any lowercase character
[A-Z]Any uppercase character
[a-zA-Z]Any character
[0-9]Any digit
sumber :
https://pythonspot.com/regular-expressions/
http://regexlib.com/DisplayPatterns.aspx?cattabindex=4&categoryId=5&AspxAutoDetectCookieSupport=1

0 comments:

Post a Comment

(^_^) [o_o] (^.^) (".") ($.$)