Make field Readonly or Non editable just by using RegEx

2694 views regex

Is it possible to make a field non editable just by using RegEx?

Thank You

answered question

1 Answer


Assuming you're talking about HTML, no. Regex simply matches string patterns, and nothing more. It can't prevent someone from editing an input field. It's not the right tool for the job.

You're likely looking for the readonly attribute for an HTML input.

posted this

Have an answer?


Please login first before posting an answer.