Reputation: 1668
I have a list of strings like this:
purpcl ("purpose clause modifier"),
quantmod ("quantier modifier"),
rcmod ("relative clause modifier"),
Is it possible to make them like this:
PURPCL ("purpose clause modifier"),
QUANTMOD ("quantier modifier"),
RCMOD ("relative clause modifier"),
Upvotes: 2
Views: 743
Reputation: 91309
It is possible with some tools, such as sed
:
$ sed -r 's/^([^(]+)/\U\1/'
purpcl ("purpuse clause modifier"),
PURPCL ("purpuse clause modifier"),
But you should definitely not use regular expressions for this kind of processing.
Upvotes: 2
Reputation: 170158
Some languages (like Perl) and/or editors (or IDE's) have such features, but in general, no, that is not possible with regex alone.
And only changing the letter that are outside of string literals is already stretching the capabilities of regex.
Upvotes: 0