Grammar Rule Not Working for "10:00AM" but Works for "10:00 AM"

I’m working on a grammar rule for detecting AM time formats in en-AU, but I’ve encountered an issue. The rule works fine for "The meeting is 10:00 AM" but does not trigger for "The meeting is 10:00AM".

<rule id="AM_TIME" name="AM">
    <pattern>
        <marker>
            <token regexp="yes">([0-9][0-9])</token>
            <token>:</token>
            <token regexp="yes">([0-9][0-9])</token>
            <token regexp="yes">am|AM</token>
        </marker>
    </pattern>
    <message>Did you mean <suggestion>\1\2\3A.M.</suggestion>?</message>
</rule>

It seems like the pattern expects a space before AM. However, I need it to work for both "10:00 AM" and "10:00AM".

Has anyone faced this issue before? How can I modify the rule to handle both cases? Any suggestions would be appreciated!

You can use Text Analysis - LanguageTool to see how tokenization works for these sentences. When patterns differ in whitespace, you typically need two rules to cover both variants.