Punctuation's are the marks, such as full stop, comma, and brackets, used in writing to separate sentences and their elements and to clarify meaning.
Questions tagged [punctuation]
451 questions
-2
votes
1 answer
Regex of getting rid of punctuations before and after a string
Is there a way I can get rid of notations at the front and the end of a string?
For example,
"hello," -> "hello"
"hello;" -> "hello"
In other words, remove all punctuation after, before, or within a word, except single quotes and single dashes if…

paupau
- 57
- 1
- 2
- 9
-2
votes
4 answers
custom php function in mysql query
my query below
working query
$sorgum = "SELECT kolon_etiketler, kolon_yazar, kolon_baslik, kolon_resim_baslik, kolon_resim_url, kolon_yazi, kolon_ytarihi FROM tb_yazilar WHERE kolon_statu = 'onay' AND kolon_yazar…

Andre Chenier
- 1,166
- 2
- 18
- 37
-2
votes
1 answer
I cannot locate my spelling/punctuation errors. My code runs fine, yet there is something wrong
I wrote out a program in Java that allows the user to name certain sports based on the number of players and vice versa using a scanner. I ran it with almost every combination I could think of, and it works fine. After submitting as a class project…

Memorial_Trash
- 13
- 3
-2
votes
2 answers
punctuation expected errors-c#
I am new to c#.I trıed to write basic average calculator.I get 60 error most of them
) expected
; expected
I checked but i think everythıng s correct.Can it be problem about that I use visual studio 2010?
using System;
using…

allstar
- 109
- 3
- 12
-3
votes
1 answer
Python Regex punctuation recognition
I am stumped by this one. I am just learning regular expressions and cannot figure out why this will not return punctuation marks.
here is a piece of the text file the regex is…

English Grad
- 1,365
- 5
- 21
- 40
-3
votes
1 answer
Spacing and pattern replacement
It is two part question:
Part 1
To remove multiple white spaces, paragraph breaks to just one.
current code:
import re
# Read inputfile
with open('input.txt', 'r') as file :
inputfile = file.read()
# Replace extras spaces with single…

Programmer_nltk
- 863
- 16
- 38
-3
votes
1 answer
Is there a better way to count punctuation in a sentence?
I want to count 'end sentences' e.g. full stops, exclamation marks, and question marks.
I have written a little loop to do this, but I was wondering if there is a better way. Not allowed to use built-in functions.
for line in textContent:
…

Neos Nokia
- 125
- 1
- 2
- 11
-3
votes
2 answers
Given an Array of strings how do I Remove Duplicates?
I would like to know how to remove duplicate strings from a container, but ignore word differences from trailing punctuation.
For example given these strings:
Why do do we we here here?
I would like to get this output:
Why do we here?

Shubham
- 25
- 9
-3
votes
1 answer
Get date and time of device without any punctuation marks
I want to get the current time and date of the device on my android app, but without any punctuation marks.
I mean like:
05112016
and
1946
How can I do that on my android app?
EDIT 1#:
The question isn't a duplicate, since the answer in the…

Ido Naveh
- 2,442
- 3
- 26
- 57
-3
votes
2 answers
Regex to remove punctuation where it isn't part of the word/value so leave %, £, ', but remove , ([ *
I've read the wiki and the other suggested material, but I can't get my head around creating this Regex.
To detail it, it is required as I need to split a sentence into words, and only the word/values so I can compare each word to others in other…

Vereonix
- 1,341
- 5
- 27
- 54
-4
votes
2 answers
Split by Regex pattern containing zero or even number of punctuation characters java
In java,I need to split a sentence by '(single quote) and sentence contains punctuation characters like ?,^ or !
The sentence gets splitted only If the sentence contains zero or even of punctuation characters,otherwise it will not split,
Note:
I…

Naveen
- 43
- 2
- 9
-4
votes
2 answers
Why doesn't this work in JavaScript: line === '}'
I'm sure this is a very basic question, but I've look quite a bit for the answer and I can't find it.
All I want to do is to see if an element in an array matches } (i.e., a right brace). But this doesn't work: line === '}'.
I can use…

globewalldesk
- 544
- 1
- 3
- 18
-4
votes
1 answer
Removing Punctuation from a String
How do I remove punctuation from a string in python? I followed the approach that someone posted on Stackoverflow, but it is not working.
punctuation = ['(', ')', '?', ':', ':', ',', '.', '!', '/', '"', "'"]
str = input("Hi, my name is Yael…

Yjell
- 17
- 1
- 1
- 3
-4
votes
2 answers
How do I use the Re Module with python to extract all punctuation tokens?
I want to extract all punctuation tokens from a text with the re module. How can I do this?

Jan Klaas
- 289
- 7
- 20
-5
votes
2 answers
Is there a way to remove punctuation at the start and end of each word in string but not the middle? Python
write a function beautify_sentence(sentence, punctuation) which returns a new sentence (type string) that removes all the specified punctuations from words (words are separated by a white space).
For example, sentence "?hello !mango! and, ban,ana…

ScrewDriver PIG
- 3
- 2