Regex help

Seh

New member
If I want to replace a text with remembering its case, is it possible like

Fir example, I have to replace hi with no and if text is Hi then new text will be No and if text is hI then new text will be nO
 

paps93fr

New member
May be in two steps.

1) First step to know cases:
- everything in lower case: [a-z]{2}
- first letter in lower case and second in upper: [a-z][A-Z]
- first letter in upper case, second in lower: [A-Z][a-z]

Store each result in a Boolean

2) Second step:
Change the string accordingly to booleans
 
Top