Difference between revisions of "Regex syntax"

From vegard.wiki
Jump to navigation Jump to search
(new page)
 
(update table)
Line 28: Line 28:
 
| <tt>\<</tt> or <tt>\></tt>
 
| <tt>\<</tt> or <tt>\></tt>
 
| <tt>\b</tt>
 
| <tt>\b</tt>
 +
|+
 +
| zero or more
 +
| <tt>*</tt>
 +
| <tt>*</tt>
 +
| <tt>*</tt>
 +
| <tt>*</tt>
 +
|+
 +
| one or more
 +
| <tt>\+</tt>
 +
| <tt>\+</tt>
 +
| <tt>\+</tt>
 +
| <tt>+</tt>
 
|}
 
|}
  
 
[[Category:Programming]]
 
[[Category:Programming]]

Revision as of 13:31, 18 April 2020

This article is currently a stub; it means I'm aware it's short and I probably intend to expand on the subject in the future!

I can never remember which programs use which regex variants, so here's a quick recap sheet.

grep (GNU) sed (GNU) vim python
capture \( ... \) \( ... \) \( ... \) ( ... )
option \| \| \| |
word boundary \< or \> \< or \> \< or \> \b
zero or more * * * *
one or more \+ \+ \+ +