I have the following code and regular expresion specified in my pattern. I am trying to get SpaCy to match 24.51c/kWh However the matched text returned is 24.51c
import spacy
from spacy.matcher import Matcher
nlp = spacy.load("en_core_web_sm")
matcher = Matcher(nlp.vocab)
pattern = [{"TEXT": {"REGEX": "[0-9]+[,.]?[0-9]+[Cc/KWHkwh]+"}}]
matcher.add("Usage", None, pattern)
doc = nlp(u"Peak Usage 409 24.51c/kWh $100.25")
matches = matcher(doc)
for match_id, start, end in matches:
string_id = nlp.vocab.strings[match_id]
span = doc[start:end]
print(match_id, string_id, start, end, span.text)
Using this regular expression works in other editors
I cannot find any SpaCy specific tester online for regular expressions. Is there something that I am missing? Any help appreciated.
Thanks

