Dapscoptyltd / Windows-and-Office-General

For issues and pointers for Windows.
0 stars 1 forks source link

Wildcards in Search and Replace Activities #12

Open Dapscoptyltd opened 5 years ago

Dapscoptyltd commented 5 years ago

There are a number of resources I've found: The Microsoft Word MVP FAQ Site The Microsoft Word MVP General information Site Pcworld Some from Rhonda Bracey More from Rhonda For help with leaving part of the wildcard experssion during replace TechRepublic info

Any single character ? s?t finds "sat" and "set."
Any string of characters * s*d finds "sad" and "started."
One of the specified characters [ ] w[io]n finds "win" and "won."
Any single character in this range [-] [r-t]ight finds "right" and "sight" and "tight."Ranges must be in ascending order.
Any single character except the characters inside the brackets [!] m[!a]st finds "mist" and "most" but not "mast."
Any single character except characters in the range inside the brackets [!x-z] t[!a-m]ck finds "tock" and "tuck" but not "tack" or "tick."Ranges must be in ascending order.
Exactly n occurrences of a character or expression { n} fe{2}d finds "feed" but not "fed."
At least n occurrences of a character or expression { n,} fe{1,}d finds "fed" and "feed."
A range of occurrences of a character or expression { n, n} 10{1,3} finds "10," "100," and "1000."
One or more occurrences of a character or expression @ lo@t finds "lot" and "loot."
The beginning of a word < <(inter) finds "interesting" and "intercept" but not "splintered."
The end of a word > (in)> finds "in" and "within," but not "interesting."
A year "YYYY" ([0-9]{1,2})([0-9]{2}) Finds '2024' or such.
Dapscoptyltd commented 5 years ago

Okay. So I needed to try and replace "Gate 0"; "Gate 1"; "Gate 2" and so on with a hyphenated construction. I tried this: Search: ([Gate])( )([0-9]) Replace: \1-\3

My thinking was logical, but flawed.

It took me a while, but: Search: ([Gate])( 0) Replace: \1-

Searches refined and used during preparation of legal documents:

Find:^t Replace:|+

Find:[0-9].[0-9]|+ Replace:Empty

Find:[0-9][0-9].[0-9]|+ Replace:|+ Style Level: Award Heading 3

Find: (*)|+ Style Level: Level 4A Replace:|+ Style Level: Award Heading 4

Find: [1-9][0-9].^space^space Style Level: Award Heading 1 Replace:|+ Style Level: Award Heading 1

(([a-z])++) This term found this numbering format:

(a)++ without selecting something like (Sailors ...) other text.

(b)++.

Dapscoptyltd commented 3 years ago

Remember that with wild cards, caret character searches don't work - like the paragraph mark...

Dapscoptyltd commented 2 months ago

^=([ High]) finds -- High. Replace with :\1 places: : High.

Dapscoptyltd commented 2 months ago

To find 'FY YYYY--YY' use: FY ([0-9]{1,2})([0-9]{2})(–[{2,}][0-9]) to find "FY 2024--25" To replace FY with 'financial year at the end use this replace function: \1\2\3 financial year

Dapscoptyltd commented 2 months ago

To find "FY--YYYY" use: FY^=([0-9]{1,2})([0-9]{2}) Replace with "YYYY financial year" with: \1\2 financial year