Project

General

Profile

« Previous | Next » 

Revision 7493

redmine_synonyms: sed pattern: Match <h# directly at the beginning of the line rather than after ^.*, which greatly speeds up the pattern matching because the first character is a literal character. (If <h# were not located at the left margin, the ^.* would unfortunately still be needed because the beginning of the line needs to be matched in order to be removed by the replacement operation.)

View differences:

bin/redmine_synonyms
8 8

  
9 9
ambigTerm=
10 10
term=
11
sed -n 's/^.*<h[1-4][^>]*>(<img [^>]*title="([^"]*):"[^>]*> *)?<a href="#[^>]+>([^<]+).*$/"\2" "\3"/p'\
11
sed -n 's/^<h[1-4][^>]*>(<img [^>]*title="([^"]*):"[^>]*> *)?<a href="#[^>]+>([^<]+).*$/"\2" "\3"/p'\
12 12
|while read -r line; do
13 13
    eval set -- $line # split to $@
14 14
    type="$1" name="$2"

Also available in: Unified diff