How can I do a search and replace with wildcards?
I need to search for text eg:
"Title of a book, author of a book, date"
and replace with
"Title of a book, date"
REPLACE Title of book,*date WITH Title of book, date
If tried using * ? etc but can't seem to do it.
Help anyone?
Search and replace with wildcard
You could use a regular expression replace -
RegEx: (Title of a book), (author of a book), (date)
Replace: $1,$3
The brackets () create capturing groups, which you reference in your replace expression using $1, $2, etc.
If you don't know the the Author, you could use a wildcard (.*) + capturing group -
(Title of a book), (.*), (date)
The regex tester screen is helpful for designing these.
RegEx: (Title of a book), (author of a book), (date)
Replace: $1,$3
The brackets () create capturing groups, which you reference in your replace expression using $1, $2, etc.
If you don't know the the Author, you could use a wildcard (.*) + capturing group -
(Title of a book), (.*), (date)
The regex tester screen is helpful for designing these.