java - Eclipse Regex Search and Replace Swap places -
i have code on class:
if (src.gettyperecord().getact().equalsignorecase("b"))
now can crash if getters return null, , team's best practices, asked convert into:
if ("b".equalsignorecase(src.gettyperecord().getact()))
i have come following regex search easier case of had value assigned variable act.equalsignorecase("b"):
(\w*).equalsignorecase\("(\w*)"\)
replace with:
"\2".equalsignorecase(\1)
which works except cases mentioned above, , this:
tos.substring(1,1).equalsignorecase("a")
could please come search , replace regex catch 2 examples mentioned above? need account situations opening if bracket adjacent, , there space if ( src.... or if (src....
thanks!
Comments
Post a Comment