Question: I have a parent div element and two nested div elements. The second child div is an audio control of arbitrary length. At least I assume it's arbitrary. My question is how can I get the first child div to take on the width of the audio control? 

I want the title to appear on only one line and to be cut off if it exceeds the desired width.

I currently have max-width set to 100% which I know will not work because the parent div does not have a defined width. I do not want the parent div to expand beyond the width of the audio control.

```css
.outer: {
  border: solid black 1px;
  display: inline-block;
  margin: 5px;
  padding: 5px;
}

.audio_text: {
  background-color: #888;
  color: #f00;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap
}
```

```html
<div class="outer">
   <div class="audio_text">My Title</div>
   <div><audio src="audio.mp3" controls></audio></div>
</div>
```

How can I prevent the text from causing the parent div to increase in size?

Answer: 
Unfortunately, lookbehinds are not supported in `JS`but you could use a "trick":  

*match* anything you **don't want** but *capture* anything you **do want**:

```
junk_a|junk_b|junk_c|(interesting_stuff)

```

So here with your specific example:

```
[$¢£]\s*-?\d+(?:\.\d+)?|(-?\d+(?:\.\d+)*)
# ^^^^^ junk part ^^^^^

```

---

Afterwards, use a little comparison that checks if the group 1 (the `interesting_stuff`) is set:

```js
let data = 'lorem ipsum 3.5 mm -2 #1 lorem ipsum $3.50 lorem ipsum';
let regex = /[\$¢£]\s*\d+(?:\.\d+)*|(-?\d+(?:\.\d+)*)/g;
let interesting = [];

while ((match = regex.exec(data)) !== null) {
    if (typeof(match[1]) != "undefined") {
        interesting.push(match[1]);
    }
}

console.log(interesting);
```

See [**a demo on regex101.com**](https://regex101.com/r/9SLNo2/2) (needs to be tweaked for the units).
You could just ignore values that begin with a dollar sign...

```js
var values = ['3.5 mm', '-2', '#1', '$3.50'];

var regex = new RegExp('^\\$');
var res = values.filter(function(val) {
  if (val.match(regex)) {
    console.log(val, 'skip');
  } else {
  return val;
  }
})

console.log(res);
```