regex - Regular expression to get only the first word from each line -
i have text file
@sp_id int, @sp_name varchar(120), @sp_gender varchar(10), @sp_date_of_birth varchar(10), @sp_address varchar(120), @sp_is_active int, @sp_role int here, want first word each line. how can this? spaces between words may space or tab etc.
here suggest:
find what: ^([^ \t]+).*
replace with: $1
explanation: ^ matches start of line, ([^ \t]+) matches 1 or more (due +) characters other space , tab (due [^ \t]), , number of characters end of line .*.
see settings:

in case might have leading whitespace, might want use
^\s*([^ \t]+).*
Comments
Post a Comment