[wplug] Regex help?

Doug Green diego96 at mac.com
Mon Apr 27 15:01:59 EDT 2015


Hi all,
I've got some work data that I'm trying to clean up. It's a single column of Excel data, each row contains a chapter/section/subsection/paragraph number followed by a string of text. I'd like to separate the heading numbers into a different column than the body of the text (creating a two column data set). 

My plan was to do a CSV export, then add a comma after the number. By re-importing the CSV this <should> put the section number in a different column than the text. Example:

7.1.3.2. Section describing general attributes of an item. 

Converted to: 

7.1.3.2., Section describing...

Emacs has a convenient replace-regex function that simply asks first what regex you want to search for and next what you want to replace it with. I've tried every combo of "[0-9]\." and "[:digit:]\." but I'm not matching ANY results. Can anyone point me in the right direction for a little help on writing a generalized regex that will match "any number followed by a period, optionally followed by up to 3 more numbers each followed by periods"? Clear as mud, right? 

Thanks!


More information about the wplug mailing list