✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

dcc.Input : How to recognize "pattern" property match in callback

I’m using the dcc.Input component with a regex on the pattern property. The input field turns red when the regex doesn’t match which is great. What I really want is to use the regex match status as an input for a callback. But I can’t figure out what property to use.

dbc.Input(
                id='input-ip',
                placeholder='Enter an ip address...',
                type='text',
                pattern=regex_ip_address,
            ),

@app.callback(Output('button-ok', 'disabled'),
              [Input('input-ip', '???')])

Hi @RustyShackleford
Would it work with “pattern”? As such:

Input('input-ip', 'pattern')])

Thanks for the suggestion. Alas, no it won’t work.
That only gets me the regex string itself. What I’m looking for is a property that is True only if the regex string matches the input value.