Sublime Forum

Comma star matching incorrectly

#1

Type the following into a blank document

Something, Something Else, Noting, more, less

Then ctrl-h to find replace use ,* as the find what and a single space character (’ ’ without the quotes) in the replace with box. Hit replace all.
You’ll end up with something like the following

S o m e t h i n g S o m e t h i n g E l s e N o t i n g m o r e l e s s

I’m ending up with spaces between every character. Even tried escaping the comma ,* but got the same result. Is this as designed? How do I get it too just replace successive commas with a space?

Sublime 3103

0 Likes

#2

,+ should be used. You may go to find a regex tutorial like http://regexone.com/ .

2 Likes

#3

Seems to work fine for me with find replace my result is

Something Something Else Noting more less

not

S o m e t h i n g S o m e t h i n g E l s e N o t i n g m o r e l e s s

0 Likes

Replace Selection (between Begin and End)
#4

Also check out RegExr & RegEx101.

RegExr has an awesome reference section that’s broken into categories, along with a test environment.   Reverse lookups are not supported.

RegEx101 offers a test environment which supports reverse lookups, includes a detailed breakdown of any patterns you’re testing, and allows you to share links to your patterns & test content ( without logging in ).

1 Like