Request: Casing for Regex-Patterns
I'm using the inputmak-plugin intensively with Regex patterns. Here's a request for the casing options:
- In addition to the existing options "upper", "lower", "title" it would be nice to have "regex" by means that this option would ensure casing at every position.
- Example pattern: [A-Z][a-z]-[A-Z][a-z]
- This would allow inputs like "Ab-De" or "Az-Za", ...
- Code:
$(inputElementId).inputmask({
regex: "[A-Z][a-z]-[A-Z][a-z]",
casing: null, //here I'd like to use "regex"
});
- This would allow to get the casing automatically done, "upper" at positions 1 and 4, "lower" at positions 2 and 5.
Too weird?
@monomorph ,
You can pass a callback to the casing option see docs.
casing: function(elem, test, pos, validPositions) { return yourmanipulated charvalue }
@RobinHerbots: Ah, looks great! I'll check this out...
@RobinHerbots: Works like a charm! Had to update my inputmask.bundle. I tested with 4.0.1-beta.25. Which is the latest stable version supporting the casing: function{} option?
@RobinHerbots: I switched to 4.0.0 for more tests. Can it be that RegEx number ranges are not supported anymore? Sth. like "[0-9]" within a RegEx pattern is not evaluated anymore?
I was on 3.3.6-10, where it was working.
@monomorph ,
Can you provide an example of the regex.
Ooops, false alarm. I was on Caps Lock... Pardon me!
I'll do some more testing and let you know...
@monomorph ,
Can this be closed?