Skip to content

Regex entities with optional words #157

@corus87

Description

@corus87

Not sure if this is a bug, a missing feature or that I just don't know how it works...

Is there a possibility to have an optional word what can or cannot be there, for example:

  1. search for moon
  2. search for the moon

both sentences should match only moon.

I can match both sentence with:
engine.register_regex_entity("(for|about) (?P<search>.*)")

but with the second phrase, I will match the moon

I played around with (|the), (|the)?, (the)? and a lot of other regex patterns...I also looked into other mycroft-skills to find a hint, but no luck...

Isn't there some kind of wildcard for this case or a regex pattern I missed?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions