how to get string till frst matching character using regrex code example Example: regex match to first instance /[^;]*/ # matches every character before the first ;