Imagine you have a string like this:
const message = 'This is a relationship: Salary = 73010 - 58.9 * Potential'
Your goal is to extract everything after relationship:
and store it in a new variable using Regex. You also want to update the original variable so that it only contains:
message = 'This is a relationship'
Here's what you've come up with so far:
const equation = new RegExp(/relationship:.*$/); // This captures everything starting from 'relationship:'
const tooltip = message.split(equation);
const tip = message.replace(equation, '');
Don't worry about being a beginner with your code. We all start somewhere, and learning Regex can be tricky at first!