How to Replace Spaces Before Timestamps with Paragraph Breaks in Word
Question details
The user needs to convert spaces preceding timestamps into paragraph breaks using advanced find and replace wildcards, ensuring the timestamp digits remain intact.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Formatting a transcript, log file, or document where timecodes run together on the same line instead of starting on new lines.
- Observed behavior
- Spaces are present immediately preceding timestamps, rather than the desired paragraph breaks separating the entries.
Ensure you have 'Use wildcards' enabled in the Find and Replace dialog, as standard searches will not recognize the required grouping expressions.
Use Find and Replace with Wildcards
Utilize advanced wildcard search parameters to locate spaces followed by digits, replacing the space with a paragraph mark while preserving the captured digit.
By grouping the first digit of the timestamp in parentheses, you can refer back to it during the replacement phase. This prevents the number itself from being deleted when the preceding space is removed.
Press Ctrl+H on your keyboard to quickly launch the Find and Replace window in your document.
Click the 'More' button to expand the advanced search options, then check the box labeled 'Use wildcards'.
In the 'Find what' text box, type a single space followed by ([0-9]). This instructs the software to locate any space followed by a digit from 0 to 9, and captures that digit into a group.
In the 'Replace with' text box, type ^p\1. The ^p code inserts a paragraph break, and the \1 code pastes back the exact digit that was captured in the first step.
Click the 'Replace All' button to automatically apply the formatting changes throughout your entire document.

Format Documents Like a Pro with WPS Office
WPS Writer offers a highly compatible and fully-featured Find and Replace tool that perfectly supports wildcard expressions, allowing you to quickly format transcripts and complex documents.
- 1. Open Your Document in WPS Writer: Launch WPS Office and open the text or transcript document you need to format.
- 2. Access Find and Replace: Navigate to the Home tab and click on Find and Replace, or simply press Ctrl+H.
- 3. Apply Wildcard Replacement: Click 'Options', check 'Use wildcards', enter ' ([0-9])' in the Find box, type '^p\1' in the Replace box, and click 'Replace All'.

Frequently Asked Questions
What does ^p mean in Word's Find and Replace?
In Word's Find and Replace tool, the code ^p represents a paragraph mark (often created by pressing Enter). It is used to find existing line breaks or insert new ones between paragraphs.
Why is my wildcard search not finding the timestamps?
Ensure that the 'Use wildcards' option is checked in the Find and Replace dialog box. Additionally, verify you typed the expression correctly; wildcard searches are strictly literal, so an accidental extra space in the 'Find what' box will cause the search to fail.
Does WPS Office support wildcard find and replace functions?
Yes, WPS Writer includes robust support for wildcards in its Find and Replace tool. The syntax and commands work identically to the advanced formatting features found in Microsoft Word.




