#1
|
|||
|
|||
Find and Replace Code Not Working
Hello
This is my sample text 02:20 key and press it again to exit full 02:22 screen tip number four 02:24 you can also use shortcut keys to 02:26 I want to delete the hard returns after the time stamps so that the text moves up next to the timestamp Also, a colon and space after the timestamp I was given two formulas 1. Find and replace with wildcards turned on Find = (:[0-9]{2})^13 Replace with = \1^t 2. This one was working Find = ([0-9]:[0-9]{2})^13 Replace = \1: Both formula's messages are: searched the selection but can't find any matches. I'm assuming that the equal sign is included in the formula? What do I need to change in the formulas to get them to work? Thanks in advance. |
#2
|
||||
|
||||
You need to provide a sample document so we can see what is at the end of the line after the numbers. The advice you were given would work if the number is followed immediately by a carriage return. If there are spaces or soft returns then the code won't work.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
I have attached an image file with show/hide characters.
I hope this will make sense. Thanks |
#4
|
||||
|
||||
The replace works fine on my machine. Are you sure you ticked the "Use Wildcards" option in the dialog?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
|||
|
|||
Yes the Use Wildcards is checked
|
#6
|
|||
|
|||
Try attaching an actual Word document file rather than a picture of a document.
How to attach a screenshot or file in this forum. |
#7
|
|||
|
|||
Thanks Charles for your response.
As per your suggestion, I attached a file with the text, and the find settings. Hope you can make sense of it. Thanks in advance. |
#8
|
||||
|
||||
The find and replace works fine on my machine using the above find strings as well as the one in your Word file.
Replacing with "\1: " also works for me. Note the space after the colon. I have no idea why this is not working on your machine. EDIT: Perhaps I do have an idea on why this won't work on your machine. Are you including formatting in either the find or the replace? If you told it to Find Bold for instance then in this case it won't find anything. If you told it to Replace with Bold then the bold will happen but the replace won't.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#9
|
|||
|
|||
It's seems to be working now.
In the search box I selected all. I don't know if that makes any difference. Can you tell me what \1: actually does and what it means? |
#10
|
||||
|
||||
\1 means whatever it found that was inside the first (curved) brackets. Because of the wildcards we don't know exactly what was found but the \1 means leave that part as it was.
The colon and the space are exactly that. Effectively, you are replacing the return with a colon space but only when the return is preceded by a pattern of ##:##
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#11
|
|||
|
|||
Thanks Guessed for all your help.
By selecting all in the search box, did it make a difference? |
#12
|
||||
|
||||
No, the selection in the dialog has no effect.
But if you have selected a range in the document before opening the dialog that can have an effect if you don't pay attention to the scope of what is searched. I suspect your earlier issues were either due to some formatting setting
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Tags |
find and replace |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find and Replace is not working | Brigitte | Word | 7 | 06-15-2021 05:10 PM |
Need VBA code for find and replace between two files | ganesang | Word VBA | 2 | 09-04-2018 06:00 AM |
Find/Replace is not working - Excel 2010 | fieldhaven | Excel | 2 | 02-19-2014 08:30 AM |
Find and Replace not working | alance | Word | 2 | 01-24-2014 02:11 AM |
MS Word Find and Replace not working | allenglishboy | Word | 10 | 07-25-2012 08:05 AM |