Wednesday, June 12, 2013

Regex POSIX expressions

I cant believe I only found out about these today, I obviously don't use regular expressions enough.

  Posix Brackets

Quick Reference:

POSIXDescriptionASCIIUnicodeShorthandJava
[:alnum:]Alphanumeric characters[a-zA-Z0-9][\p{L&}\p{Nd}]\p{Alnum}
[:alpha:]Alphabetic characters[a-zA-Z]\p{L&}\p{Alpha}
[:ascii:]ASCII characters[\x00-\x7F]\p{InBasicLatin}\p{ASCII}
[:blank:]Space and tab[ \t][\p{Zs}\t]\p{Blank}
[:cntrl:]Control characters[\x00-\x1F\x7F]\p{Cc}\p{Cntrl}
[:digit:]Digits[0-9]\p{Nd}\d\p{Digit}
[:graph:]Visible characters (i.e. anything except spaces, control characters, etc.)[\x21-\x7E][^\p{Z}\p{C}]\p{Graph}
[:lower:]Lowercase letters[a-z]\p{Ll}\p{Lower}
[:print:]Visible characters and spaces (i.e. anything except control characters, etc.)[\x20-\x7E]\P{C}\p{Print}
[:punct:]Punctuation and symbols.[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~][\p{P}\p{S}]\p{Punct}
[:space:]All whitespace characters, including line breaks[ \t\r\n\v\f][\p{Z}\t\r\n\v\f]\s\p{Space}
[:upper:]Uppercase letters[A-Z]\p{Lu}\p{Upper}
[:word:]Word characters (letters, numbers and underscores)[A-Za-z0-9_][\p{L}\p{N}\p{Pc}]\w
[:xdigit:]Hexadecimal digits[A-Fa-f0-9][A-Fa-f0-9]\p{XDigit}

3 comments:

  1. Thanks for telling this story.

    ReplyDelete

  2. When looking for high-quality printing solutions, many businesses turn to innovative options like custom dtf transfer to achieve vibrant and durable designs. These transfers are perfect for customizing a variety of fabrics and ensuring long-lasting results. Whether you're creating apparel or promotional items, this method offers flexibility and excellent print quality. For those interested in exploring this option, more information can be found at the provided link.

    ReplyDelete

Building KubeSkippy: Learnings from a thought experiment

So, I got Claude Code Max and I thought of what would be the most ambitious thing I could try "vibe"? As my team looks after Kuber...