Copying and Pasting

Mr Smiley

Senior member
Oct 12, 2004
550
1
0
Have you ever wanted to copy and past code from a tutorial but it was formatted so there are numbers on every new line. You could copy the code and delete the numbers but that takes time. Or have you ever wanted to highlight specific words in a text document instead of highlighting the entire line. It is such a hassle to copy and paste things with these highlighting limitations. Am I missing something obvious because there must be some way to do this.
Here is an example of the code I was talking about:
1. <?
2. phpinfo();
3. ?>
Is there anyway to just highlight the code and not the numbers? This seems like a nub question but I just can't figure this out!
 

Thyme

Platinum Member
Nov 30, 2000
2,330
0
0
Try using an editor that allows you to search/replace regular expressions, then try something like replacing $[0-9]{1,}. with the empty string. The editor will probably have its own regular expression syntax, but basically you can delete a new line starting with a number, ending with a dot.