How to remove all after question mark '?'

Jim@bookman-jim.biz?subject=Blah,Blah,Blah, …

I have the above in many cells and want to remove everything after the “?”
Tried ‘…’ and '" in FIND - but only removes the “?”, (reg expression is √ed)
How to FIND and replace all after ‘?’ with ’ ’ ?

Tnx,
⌡im

You surely mean:

including the question mark itself, right?

Removing just the “?” question mark is easy.
It’s all the various stuff behind the “?” question mark (and the question mark too would be helpful)

(.*?)\?.*$ (Reg Exp √ed) removes the whole entry.

[erAck: edited to mark the regex as code by surrounding it with ` backticks, otherwise asterisks are interpreted as markup and lead to italics display and backslash is munged]

You overlooked that the Replace field contains $1

Menu Data - Text to Columns, separated with Other [?]. Needs to select the second column and choose Hide.

3 Likes

1 Like

Going the direction of the OQ, you could use

=LEFT(E5,FIND("?",E5)-1)

to truncate the entire URI in E5.

1 Like

That worked !
Little horsing around, but WORKS !

Thank You,
⌡im

Needs an extra column, but it is dynamic.