public static BooleanBinding matches ( final ObservableValue < String > text , final String pattern ) { return Bindings . createBooleanBinding ( ( ) -> { final String textToVerify = text . getValue ( ) ; return textToVerify != null && textToVerify . matches ( pattern ) ; } , text ) ; }
Creates a boolean binding that is true when the given observable string matches the given RegExp pattern .