Skip to content

Instantly share code, notes, and snippets.

View mohnish82's full-sized avatar

Mohnish Chaudhary mohnish82

View GitHub Profile
@mohnish82
mohnish82 / RegexBackref.java
Created October 17, 2020 18:02
Java regex search & replace using backreference
Strig input = "_ab__f_";
//Pattern p = Pattern.compile("_+(.)", Pattern.DOTALL);
// pattern with named backreference i.e. (?<firstElement>)
Pattern p = Pattern.compile("_+(?<firstElement>.)", Pattern.DOTALL);
Matcher m = p.matcher(input);
StringBuffer buff = new StringBuffer();
@mohnish82
mohnish82 / keybindings.json
Created August 7, 2021 20:42
Vscode key mapping
[
{
"key": "ctrl+left",
"command": "cursorWordPartLeft",
"when": "textInputFocus"
},
{
"key": "ctrl+right",
"command": "cursorWordPartRight",
"when": "textInputFocus"