regular expression end with first occurrence of character code example Example: regex match to first instance /[^;]*/ # matches every character before the first ;