Ignore:
Timestamp:
2018-02-13T10:38:29+13:00 (6 years ago)
Author:
kjdon
Message:

After () in a regex, {} signifys quantifiers. eg (xx){2,4} - 2-4 occurrences. In later perl versions, it is illegal to have an unescaped { after a ) in a regex. If you actually want to match { you need to escape it. So I have escaped all { following ) in regex

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/BibTexPlugin.pm

    r32122 r32129  
    704704           
    705705    # remove {} around a single character (eg \'{e})
    706     $text =~ s@(\\[`'="^~\.]){(\w)}@{$1$2}@g; #`
     706    $text =~ s@(\\[`'="^~\.])\{(\w)}@{$1$2}@g; #`
    707707
    708708    # \, is another way of doing cedilla \c
     
    711711    # remove {} around a single character for special 1 letter commands -
    712712    # need to insert a space. Eg \v{s}  ->  {\v s}
    713     $text =~ s@(\\[uvcH]){(\w)}@{$1 $2}@g;
     713    $text =~ s@(\\[uvcH])\{(\w)}@{$1 $2}@g;
    714714
    715715    # only do if the text contains a '\' character.
Note: See TracChangeset for help on using the changeset viewer.