Check for whitespace in antipattern

I have the problem that I need to check for whitespace in an antipattern (or exception) but I don’t find a way to do so. Let me share the specific example first:

<pattern case_sensitive="yes">
    <token postag='(SUB|EIG|PRO:PER):NOM:.+' postag_regexp='yes' />
    <token postag='VER:.+' postag_regexp='yes'>
        <exception regexp="yes" inflected="yes">ein|bitte|werden</exception>
    </token>
    <token postag='(ART:.+|PRP:LOK.+)' postag_regexp='yes' min='0' />
    <token postag='(SUB|EIG):.+' postag_regexp='yes' skip="-1">
        <exception scope="next" regexp="yes">(und|oder|–|-|&klam;|&anf;|,|:|\.|\n)</exception> 
    </token>
    <marker>
        <token>
            <match no="1" postag='VER:.+' postag_regexp='yes'/>
        </token>
    </marker>
    <token min="0">
        <exception postag='(SUB|EIG|ART|PRO:PER):.+' postag_regexp='yes'></exception>
    </token>
</pattern>
...
<example correction="">Die CSU ist in Bayern nach einer Prognose des Bayerischen Rundfunks auf 38,5 Prozent gefallen <marker>ist</marker>.</example>
<example>Du kaufst Nudeln, kaufst aber keinen Rotwein?</example>

In line 8 I make an exception that is triggered, among others, by a comma, to avoid a false alarm in example 2. The problem is that this exception is also be triggered if there is a number with a comma, preventing the rule to be triggered for example 1. How can I make an exception that only triggers for a comma followed by a whitespace?

  • type=exact is only allowed for <regexp>, so I can’t add whitespace to the regular expression here
  • <regexp> can neither be used in exceptions nor in antipatterns
  • RegexAntiPatternFilter doesn’t work with whitespace
  • there is a spacebefore but not a spaceafter parameter

How could I solve this?

Would an antipattern work here?

I am trying to write one, but it is a bit complex because of the reasons stated above.

Ok, it seems to work with this antipattern:

<antipattern>
    <token postag='VER:.+' postag_regexp='yes' />
    <token postag='(ART:.+|PRP:LOK.+)' postag_regexp='yes' min='0' />
    <token postag='(SUB|EIG):.+' postag_regexp='yes' skip="-1" />
    <token regexp="yes">(,|\.|:)</token>
    <token spacebefore="yes" />
</antipattern>