To remove text from the start of the line
Let's say we want to remove 'aaa' from the start of each line, use search text of
Code: Select all
[lineStart]aaa
Code: Select all
[lineStart, 'aaa' ]
Code: Select all
[lineStart, longest 1+ tab or space or verticalTab ]
Code: Select all
[lineStart, longest 1+ whitespace ]
To remove one or more > characters (like in an email reply), use
Code: Select all
[lineStart, longest 1+ space or tab or '>' ]
To remove one or more numbers (e.g. line numbers), use
Code: Select all
[lineStart, longest 1+ digits ]
Code: Select all
[lineStart, longest 1+ digits or '.' or '$' ]
Learning: [lineStart] is a position which matches the start of the line or the start of the file.
Literal text is included either inside the EasyPattern brackets inside quotes, or outside the [] EasyPattern brackets.
If we have a repeat at the end of our match (e.g. 1+ spaces) then we must use the keyword longest to force EasyPatterns to find the longest match.
To remove text from the end of the line
Let's say we want to remove '###' from the end of each line, use search text of
Code: Select all
[lineEnd]###
To remove one or more white space characters at the end of the line, use
Code: Select all
[ 1+ tab or space, lineEnd ]
Code: Select all
[ 1+ whitespace, lineEnd ]
To remove one or more numbers (e.g. line numbers), use
Code: Select all
[ 1+ digits, lineEnd ]
Code: Select all
[ 1+ digits or '.' or '$', lineEnd ]
Learning: [lineEnd] is a position which matches the end of the line or the end of the file.
We don't need the keyword longest here, because the pattern won't match until it find a lineEnd at the end.
See: http://www.datamystic.com/easypatterns_reference.html
If you have ideas for more 'How To's' please drop a note in the forums or send us an email.