![]() |
regexp question: first instance for each line
So I have some text like:
Code:
Identification_Information:Code:
(\w?[A-Z][a-z].+:)Code:
Identification_Information: |
Code:
(\w?[A-Z][a-z].+?:)edit> actually this should do it.. Code:
(.+?:) |
Quote:
Code:
(.+?:)Code:
Supplemental_Information:Supplemental_Information: (contact information below). web site (http://www. Process_Description: environment to a 1:250,000 topographic basemap. Other_Citation_Details: 15 p., 1 sheet, scale 1:250,000 Online_Linkage: http://www. which is close. I still need to get rid of any other text beyond the first colon. I tried placing: Code:
{1} |
Here's my last attempt before I hit the sack...
Code:
(\w?[A-Z][a-z].+[a-z]:[^//0-9])Code:
Supplemental_Information:Ordering: Order by phone, Payment accepted: Cash, check, money order, VISA, or MasterCard which is still: Code:
Ordering: Order by phone, Payment accepted: |
Using sed i get this:
Code:
$ sed -n 's/\ *\([A-Z][^:]*:\).*/\1/p' file |
Quote:
Code:
^(.+?:) |
Thanks muha and xhi. This problem wasn't related to any specific language. I needed a regexp to highlight all elements in a metadata file using the program EditPad Pro.
Code:
^(.+?:) |
| All times are GMT -5. The time now is 07:10 PM. |