Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

5
LINES

< > BotCompany Repo | #1026769 // phraseToRegExp (with smart word boundaries)

JavaX fragment (include)

1  
sS phraseToRegExp(S b) {
2  
  ret (startsWithLetterOrDigit(b) ? "\\b" : "") +
3  
    regexpQuote(b) + 
4  
    (endsWithLetterOrDigit(b) ? "\\b" : "");
5  
}

Author comment

Began life as a copy of #1026551

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026769
Snippet name: phraseToRegExp (with smart word boundaries)
Eternal ID of this version: #1026769/2
Text MD5: 7edc8bdb107113ecdbbbb0f6007773d7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-21 15:00:45
Source code size: 147 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 120 / 148
Version history: 1 change(s)
Referenced in: [show references]