Hi Perlers,
I need some help with a regex I can't figure out.
In short, I need to enclose all occurences of certain "label"
strings in a text file into '^' marks.
I.e., for example:
"See SAY_PLEASE_TXT and SAY_HELLO_TXT."
Those string codes *always* come in all caps, and with *at least*
one underscore character.
The strings in capitals (with underscores) refer to string codes,
which should be enclosed in special '^' marks, so that the above
example should be changed to:
"See ^SAY_PLEASE_TXT^ and ^SAY_HELLO_TXT^."
I've managed to find some clues in Perl Cookbook, and got some
results with modified "all caps" recipe:
s/[^\Wa-z0-9]+\_/^$1^/g
but, instead of enclosing the label into carets, it *replaces* the
found text - and, besides, it does not find the whole string. In
short, the above produces:
"See ^^TXT and ^^TXT."
which is definitely NOT what I wanted :-)))
So, if anyone has any ideas and suggestions, I'd be more than
grateful...
TIA,
Denis
---------------------------------------------------------------------
<-- Croatian Translation & Language Services --> * [EMAIL PROTECTED]
--------------------------------------------------------------------+
Denis Pleic | Phone: (+385) 42 230-751
Vodnikova 15 | Fax: (+385) 42 231 598
HR-42000 Varazdin| Mobile: (+385) 98 798 323
CROATIA | http://www.open.hr/~dpleic/indx-e.html
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users