Copy link to clipboard
Copied
I am doing a catalog and and I have multiple variable
Sorry, missed that.
[Ff]rom\s(\d+)\syears\sto\s(\d+)\syears
Copy link to clipboard
Copied
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.
And so:
Find what: (\d) years to (\d)
Change to: $1~=$2
Change All
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Also forgot to mention that the use of \d+ picks up numbers that are more than one digit, in case you have those, too.
Copy link to clipboard
Copied
now it looks like this
Ages From 0 - 4 years
it needs to be :
Ages From 0 - 4 years?
Getting there!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
i still need to remove the "years at the end "
Ages 3–6 years ?
Copy link to clipboard
Copied
Sorry, missed that.
[Ff]rom\s(\d+)\syears\sto\s(\d+)\syears