SQL
`COLUMNS` Regular Expression
`COLUMNS` supports passing a regex in as a string constant:  
```sql
SELECT COLUMNS('(id|numbers?)') FROM numbers;
```  
<div class="narrow_table"></div>  
| id | number |
|---:|-------:|
| 1  | 10     |
| 2  | 20     |
| 3  | NULL   |  
#### Renaming Columns Using a `COLUMNS` Expression {#docs:sql:expressions:star::renaming-columns-using-a-columns-expression}  
The matches of capture groups can be used to rename columns selected by a regular expression.
The capture groups are one-indexed; `\0` is the original column name.  
For example, to select the first three letters of colum names, run:  
```sql
SELECT COLUMNS('(\w{3}).*') AS '\1' FROM numbers;
```  
<div class="narrow_table"></div>  
| id | num  |
|---:|-----:|
| 1  | 10   |
| 2  | 20   |
| 3  | NULL |  
To remove a colon (` :`) character in the middle of a column name, run:  
```sql
CREATE TABLE tbl ("Foo:Bar" INTEGER, "Foo:Baz" INTEGER, "Foo:Qux" INTEGER);
SELECT COLUMNS('(\w*):(\w*)') AS '\1\2' FROM tbl;
```