Regular Expressions 101

Community Patterns

align text in columns p2

0

Regular Expression
PCRE (PHP <7.3)

/
(?:^|\t) ( [^\t\n]+(?=(?:\t|\n[^ ])) | [^\t\n]+(?=(?:\t|\n([ ]+))) ) #(|[ ]{20})#(?![ ]{3,}) #| #[^\t]+?(?=(?:\n)([ ]+)")
/
gxsm

Description

part 2 of two-step replacement routine: before: abc def gh gk n opq

after: 'abc def gh 'gk n opq

Submitted by anonymous - 5 years ago