|
|
|
|
|
by comex
905 days ago
|
|
I use all of those tools but the inconsistency drives me crazy as it's hard to remember which syntax to use where. Here's how to match the end of a word: ripgrep, Python, JavaScript, and practically every other non-C language: \b vim: \> BSD sed: [[:>:]] GNU sed, GNU grep: \> or \b BSD grep: \>, \b, or [[:>:]] less: depends on the OS it's running on |
|
And then there's \p{Letter}. It can be spelled in a lot of ways: \pL, \p{L}, \p{Letter}, \p{gc=Letter}, \p{gc:Letter}, \p{LeTtEr}. All equivalent. Very few regex engines support all of them. Several support \p{L} but not \pL. See: https://github.com/BurntSushi/rebar/blob/f9a4f5c9efda069e798...