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: 
You need to anchor the match to the start of the string by adding a `^` to the front. I do not really understand what you are trying to accomplish by the most of your regular expression though.

If you just want anything that doesn't start with a currency symbol, try `^[^\$¢£].*$`.
Anything that doesn't contain *any* currency symbol, try `^[^\$¢£]*$`.
Anything that contains a number (optionally decimal, always contain the whole part like you seem to intend), surrounded optionally by "non-currency symbols", try `^[^\$¢£]*[0-9]+(\.[0-9]+)?[^\$¢£]*$`.
As an alternative, maybe you could match the numbers that represent a price and replace the match with an empty string:

[`[£$¢]\d+(?:\.\d+)? *`](https://regex101.com/r/ua9NXk/1)

```js
var pattern = /[£$¢]\d+(?:\.\d+)? */g;
var text = `3.5 mm
This is 3.5 mm.
-2
This is -2 and test
This is #1 and test
#1
$3.50
$3.50
This is $3.50.
This is $3.50 a test
This is a £100000 test and $5000.00 test.
This is a ¢100000 test`;

console.log(text.replace(pattern, ""));
```