Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
^(.*ext[2-4]|.*xfs)(\s+)((([a-zA-Z\=\-]+)(?!noatime,nodireatime)).+)
"
gm

Description

var: grub_opts: 'elevator=noop'

  • name: OPTIMIZ | FSTAB | Set {{ fstab_opts }} replace: dest: /etc/fstab backup: yes regexp: '^(.*ext[2-4]|.*xfs)(\s+)((([a-zA-Z=-]+)(?! {{ fstab_opts }})))(\s+)([0-9].+)' replace: '\1 \2 \3,{{ fstab_opts }} \6 \7' tags: optimization,disk,fstab
Submitted by anonymous - 8 years ago