|
|
#1 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 129
Karma: 5754
Join Date: Jan 2012
Location: South Africa
Device: Kindle 4
|
Regex to insert word at beginning of a line
Want to change xxx xxxx, The to The xxx xxxx.
In the replace section, how do I specify at the beginning of the line? Python reference speaks of ^ and \B, but how do I use them to stop them being appended to the end of the line? If I make the replace regex \BThe or \B The it just appends at the end of the line. Somehow I am missing telling it: This is an escape sequence, not normal characters. I always thought that if you want a \ you needed to use \\. |
|
|
|
|
|
#2 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 129
Karma: 5754
Join Date: Jan 2012
Location: South Africa
Device: Kindle 4
|
Got it
Code:
(.*)(, )(The) \3 \1 |
|
|
|
| Advert | |
|
|
![]() |
| Tags |
| regex |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Regex to search at beginning of line | kakkalla | Sigil | 30 | 06-03-2013 03:08 PM |
| Regex Help - Add Book - Insert Filename into Custom Field | nynaevelan | Library Management | 3 | 10-12-2011 01:14 PM |
| how to insert break-line | schuster | Recipes | 1 | 05-24-2011 03:19 PM |
| Insert new line with regex | deckoff | Sigil | 6 | 08-08-2010 11:24 AM |
| Fb2 Input (Do not insert a ToC at the beginning) | Garfunkel | Calibre | 0 | 10-08-2009 01:49 PM |