get anything between first X and first X regex code example Example: regex match to first instance /[^;]*/ # matches every character before the first ;