EN
Regex - convert from underscore to camel case notation
11 points
To convert from underscore to camel case notation we can use below regex.
xxxxxxxxxx
1
Regex:
2
_([a-z0-9])
3
4
Replace with:
5
\U$1
6
7
// BEFORE:
8
db_column_name
9
10
// AFTER:
11
dbColumnName
Tested with notepad++.
Notes:
- ensure to have 'Regular expression' radio button checked.
Motivation:
Why I like to use it?
- Because I don't need to convert SQL field names manually and it saves my time.
- I usually use it to when creating java entity and need to convert more then 3 fields from mysql underscore notation (really handy).
Screenshot before:

Screenshot after:

xxxxxxxxxx
1
// BEFORE:
2
picture_id
3
picture_hash_id
4
picture_filename
5
user_id
6
picture_upload_time
7
8
// AFTER:
9
pictureId
10
pictureHashId
11
pictureFilename
12
userId
13
pictureUploadTime