I am doing a catalog and and I have multiple variable
In the Find/Change GREP field:
\d is any digit.
(\d) could be recalled in the replace field as $0, or $1, or $2
Make sure you set an EN dash; not a hyphen; between ranges of numbers.
Find what: (\d) years to (\d)
Change to: $1~=$2
Mikes answer assumes an ordinary typed space.
I would perhaps use (\d+)\syears\sto\s(\d+) which will find other types of spaces as well.
I also prefer to change to $1~<~=~<$2 which adds a thin space on either side of the en-dash
Also forgot to mention that the use of \d+ picks up numbers that are more than one digit, in case you have those, too.
now it looks like this
Ages From 0 - 4 years
it needs to be :
From 0 - 4 years?
Okay, instead of just (\d+)\syears\sto\s(\d+) use [Ff]rom\s(\d+)\syears\sto\s(\d+) which will pick up the "from" and eliminate it with the following space. The [Ff] class will pick it up whether or not it is capitalized.
i still need to remove the "years at the end "
Ages 3–6 years ?
Sorry, missed that.