RegexInputFilter

class RegexInputFilter(beforeRegex: String?, afterRegex: String?, ignoreCause: Boolean) : InputFilter

正则输入过滤器

Parameters

beforeRegex

正则匹配每次输入内容, 如果不匹配则不会允许显示到输入框中, 如果为null则不参与匹配

afterRegex

正则匹配输入后内容, 如果不匹配则不会允许显示到输入框中, 如果为null则不参与匹配

ignoreCause

忽略大小写

Constructors

RegexInputFilter
Link copied to clipboard
fun RegexInputFilter(beforeRegex: String? = null, afterRegex: String? = null, ignoreCause: Boolean = false)
正则匹配每次输入内容, 如果不匹配则不会允许显示到输入框中, 如果为null则不参与匹配

Functions

filter
Link copied to clipboard
open override fun filter(source: CharSequence, start: Int, end: Int, dest: Spanned, dstart: Int, dend: Int): CharSequence?

Properties

afterRegex
Link copied to clipboard
var afterRegex: String? = null
正则匹配输入后内容, 如果不匹配则不会允许显示到输入框中, 如果为null则不参与匹配
beforeRegex
Link copied to clipboard
var beforeRegex: String? = null
正则匹配每次输入内容, 如果不匹配则不会允许显示到输入框中, 如果为null则不参与匹配
ignoreCause
Link copied to clipboard
var ignoreCause: Boolean = false
忽略大小写