In PyCharm Community, you can have multiple carets. Press and hold and then click at different positions to set additional carets in the editor. Alternatively, press twice and hold the key, and then press the arrow keys.

Multiple carets

You can then press with the left or right arrow keys to select multiple text fragments.

Multiple selection

Press &shortcut:EditorEscape; to remove all the additional carets but the most recently added one.