Copy link to clipboard
Copied
Hi guys,
Is it possible in Grep to delete the last line?
Thanks

Hi,
you cannot remove something using a GREP Style.
If you like you can make it invisible using e.g. a character style that applies No Fill and No Stroke, but you cannot remove it.
Regards,
Uwe
Copy link to clipboard
Copied
Sorry - should be last line with keyword "Phone"

Copy link to clipboard
Copied
Hi,
if you find a pattern that describes all lines you want to remove starting with "Phone:" you can do this with GREP Find/Replace.
And if all the lines share the same paragraph style, the better you will be able to find the right lines.
A possible GREP pattern could be:
\s?Phone:\s\d{2}\s\d{4}\s\d{4}
Since you were showing an example without turning on Hidden Characters I cannot tell if this will work since I do not know if white space of any kind is following after the last sequence of numbers.
Regards,
Uwe
Copy link to clipboard
Copied
Hi Uwe,
How this could work with paragraph grep style?

Copy link to clipboard
Copied
Hi,
you cannot remove something using a GREP Style.
If you like you can make it invisible using e.g. a character style that applies No Fill and No Stroke, but you cannot remove it.
Regards,
Uwe
Copy link to clipboard
Copied
sarahkay wrote
How this could work with paragraph grep style?
As Uwe said already, it won't. The keyword here is style. You can't edit content just applying text style. Nevertheless you still have more than one option:
1. Using Find/Change just find and remove unwanted text. Since your phone numbers don't follow a strict pattern I would use something like Phone:[\x{20}\d]+
Simple and reliable, but can not be undone later.
2. Using the same regex find your text and apply special char or para style to it, using color [None] or [Paper]. It will effectively hide unwanted text.
This approach could be used as a 'paragraph grep style'. Not really recommended since *hidden* text portions are still here, and they will re-appear if you copy / paste your text, say, to another application.
3. Use conditional text feature: create new condition for your Phone lines, using Find/Change and regex from above apply that condition to text that should be 'removed'. Now you have full control: you can turn Phones condition visibility on/off, copy/paste correct text to another apps, etc.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now