# [almost-patch] Add diff regular expressions for Markdown and Zshell

1 messages from 2020-02-25 to 2020-02-25. Participants: Sebastian Gniazdowski.
Thread: https://gitlist.dev/t/52882

## Sebastian Gniazdowski, 2020-02-25 13:56

Subject: [almost-patch] Add diff regular expressions for Markdown and Zshell
Message-ID: <CAKc7PVAWwJSAMbqyn-EOiTn7nc_dXHrqD68JtwdrK8-WN2mkUA@mail.gmail.com>
URL: https://gitlist.dev/e/CAKc7PVAWwJSAMbqyn-EOiTn7nc_dXHrqD68JtwdrK8-WN2mkUA%40mail.gmail.com

```
Hi.
Git comes with a few of the diff-regexes built-in. They are listed
here: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header

I'm a Zsh plugin creator and I've found the following regexes to be useful:

- Zshell function-matching:
    xfuncname =
"^((function[[:blank:]]+[^[:blank:]]+[[:blank:]]*(\\(\\)|))|([^[:blank:]]+[[:blank:]]*\\(\\)))[[:blank:]]*(\\{|)[[:blank:]]*$"

- Markdown hading-matching:
    xfuncname = "^#+[[:blank:]].*$"

Could those regexes be added to the built-in set? I think that they're
extremely useful and shipping them with Git would lift the requirement
of having them in each .gitconfig on each machine – particularly
useful for e.g.: receiving bug-reports from Zsh-plugin users, that may
have the patterns not set up.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org

```
