How to filter content for specific content variable

the_content will return the whole content of the post and not particular part. If you want to access your particular part, then you can go for shortcode.

For eg, if you have content like this in your post

Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry’s [mycustomtextpart]
standard dummy text ever since the 1500s, when an unknown printer took
a galley of type and scrambled it to make a type specimen book. It has

Then use do_shortcode function to make changes in the [mycustomtextpart] section. Refer.

tech