Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- End of Line
- Search for End of Line in Unix, or Old MacOS, or Windows format
- Equivalent to \R. Use \R in RegEx dialects that have \R. Dialects that I am aware have \R
- Java
- PCRE
- Perl
- PHP
- Ruby
- Use the ugly circumvention below in dialects that do not have \R. Circumvention seems to work in dialects with and without \R. I have tested circumvention in
- .NET
- Go
- Java
- JavaScript
- PCRE
- Perl
- PHP
- Python
- XRegExp
- And the circumvention is ...
- (\r|\r?\n)
- File with Listed Extension contained in a Line
- Search for line with file extension. .jpeg used in example.
- ^.*\bƸExtensionƷ\b.*(?![<>\(\)"]$)
- Example
- ^.*\b\.jpe?g\b.*(?![<>\(\)"]$)
- File with Listed Extension NOT contained in a Line
- Search for line WITHOUT any of the (file extensions in a list of file extensions). Example uses CSS|HTML|Several graphics extensions|Fonts.
- ^(.(?!ƸExtensionsƷ))+$
- Example
- ^(.(?!\.(css|html|ico|jpg|js|svg|woff\d?)\b))+$
- Hex Dump
- For a binary display (hex dump) where each Line consists of 3 sections: an offset onto the dump, and 2 data representation sections
- *( Whitespace ) Offset = 8(hexadecimal digits) Whitespace
- DataAsHex = 16( Whitespace 2(hexadecimal digits) ) Whitespace
- DataAsChar = 16( Characters )
- Search for Line excluding DataAsChar section
- ^\s*[\dA-Fa-f]{8}\s+(?:\s+(?:(?:[\dA-Fa-f]{2})|(?:\.{2}))){16}\s+\B
- Line Does Not Contain String
- Select line that does not contain string ƸNotStringƷ. Use Multiline option.
- ^(?!ƸNotStringƷ).)+$
- Relative Path
- Search for a path relative to current directory. Path must be in simplest form: first object in relative path must be an object directly under current directory. No Current Directory symbol (.). No Parent Directory symbol (..). Relative path must come immediately after a preceding text line (no intervening blank lines) and be on its own line (end with a newline)
- [^\r\n](\r|\r?\n)(\w[\w\/]+(\r|\r?\n))
- Replace starting newline with 3 newlines, adding 2 blank lines
- $1$1$1$2
- UUID aka GUID
- Search for a Universally Unique Identifier
- (UUID) aka a Globally Unique Identifier (GUID). Example eliminates lines with a semicolon anywhere before the UUID.
- \b[A-F\d]{8}-([A-F\d]{4}-){3}[A-F\d]{12}\b
- ^[^;]*\b[A-F\d]{8}-([A-F\d]{4}-){3}[A-F\d]{12}\b
- URL
- Courtesy of Internet Marketing Ninjas (https://www.internetmarketingninjas.com/tools/website-pattern-extractor/)
- (ht|f)tp(s?)\:\/\/[a-zA-Z0-9\-\._]+(\.[a-zA-Z0-9\-\._]+){2,}(\/?)([a-zA-Z0-9\-\.\?\,'\/\\+&%\$#_]*)?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement