Quantcast
Channel: CodeProject Latest postings for Regular Expressions
Viewing all articles
Browse latest Browse all 224

Swap two values based on pattern

$
0
0
To cut down the detail, here is my input:
 
[char](15)
[varchar](23)
 
So the first field is a square bracket '[', a string and a close bracket ']'. Next is a regular bracket '(', a number, and a close bracket ')'.
 
I want to use Emacs to replace so here is the result:
 
15 char
23 varchar
 
So take out all those bracket or square bracket. Number goes first, a space and the string.
 
How to do it? I know how to swap values, but adding the pattern of string, I don't know.

Viewing all articles
Browse latest Browse all 224

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>