Hi there
i'm trying to copy the text from the clipboard. the clipboard could be a url or just a sentence with comma & dots etc..
i'd like to strip out the [tabs, white spaces, returns, new lines] from the beginning of a word and I don't want to those stuff after the last word or beginning of a new line as well.
example:
space space space tab new line
new line
tab space space sentence 1tab, new line new line
tab space sentence 2
so i want to strip out from the beginings and at the ends
so above text will be like
sentence 1 new line
sentence 2
i wrote some really crazy stupid reg ex like this: (?:\s.\t.\n.\r.(?<1>[*].)|(?<1>\S+))
and i can only get the last word of sentence 2
surely i'm new to reg ex
please help
i'm trying to copy the text from the clipboard. the clipboard could be a url or just a sentence with comma & dots etc..
i'd like to strip out the [tabs, white spaces, returns, new lines] from the beginning of a word and I don't want to those stuff after the last word or beginning of a new line as well.
example:
space space space tab new line
new line
tab space space sentence 1tab, new line new line
tab space sentence 2
so i want to strip out from the beginings and at the ends
so above text will be like
sentence 1 new line
sentence 2
i wrote some really crazy stupid reg ex like this: (?:\s.\t.\n.\r.(?<1>[*].)|(?<1>\S+))
and i can only get the last word of sentence 2
surely i'm new to reg ex
please help