9,068 questions
0
votes
1
answer
38
views
How to prevent unescaped program arguments
This test program parses a single text argument, which could be a URL:
#!/usr/bin/env python
import argparse
def parse_input():
parser = argparse.ArgumentParser(
description='Program ...
3
votes
3
answers
79
views
regex to match all unescaped '$' in a regex string
I want to build a regex that will match all unescaped $ in strings that represents a regex.
In this case, a character is unescaped if it contains an equal number of backslashes behind it (each pair of ...
-2
votes
0
answers
59
views
How to use code (`(?{ ... })`) in right side of substitute? [duplicate]
I did some home-grown escaping and un-escaping of space characters in perl 5.26.1, but it does not work as expected:
I escape characters using $c = "\001" . sprintf('%002x', ord($c)), and my ...
0
votes
0
answers
57
views
Why does my last printed line disappear when using \r in VS Code terminal
why in this code in the vs code the last output cleared I think we should have "...." ??
from time import sleep
c=1
while c<5 :
print("."*c+"\r",end='')
sleep(...
0
votes
0
answers
40
views
Why does \t produce different numbers of spaces in Python output? [duplicate]
In this code I use \t as tab but in one of them the out put has 8 spaces and in one of them the out put has 7 spaces instead tab(\t) how python calculate this how should we know how many spaces we ...
0
votes
1
answer
63
views
How do I use the printf command with a format string beginning with "-"? [duplicate]
I have some items:
items=(one two three)
And I want to print them with leading -, to give this output:
- one
- two
- three
The obvious format string fails:
printf '- %s\n' "${items[@]}"
...
1
vote
1
answer
64
views
Powershell escape in LUA script
Trying to kill some child processes (given parent pid) from within a lua script. Found solution using wmic but prefer using powershell.
I can run each of these powershell commands in a standard ...
-4
votes
1
answer
102
views
How to pass raw JSON with spaces and tabs to a struct in Go without extra escaping or marshaling
I'm working with a Go application where I need to pass raw JSON data to a struct field, but I am encountering issues with extra escaping when marshaling the struct, especially when the raw JSON ...
0
votes
1
answer
57
views
Can't Query AWS Athena Presto Table Because of Dash Character in Column name
I have a file in S3 with the following contents:
{"foo-bar": {"name":"Mercury","distanceFromSun":0.39,"orbitalPeriod":0.24,"dayLength":58.65}...
-3
votes
1
answer
52
views
Using special characters in a Django template tags
I am trying to make a field with Django Tweaks and I am trying to add some HTMX attributes. I want to use the following syntax:
{% render_field field <other attributes> hx-vals='{"country&...
0
votes
0
answers
50
views
Dbeaver Generate SQL function adds unwanted escape characters
Often I want to make copies of a report in my reports table for some small modifications. Then I always query the report I want to copy select * from reports where id = 1 After that I right click on ...
1
vote
2
answers
104
views
Mixing \e and other escape characters
I recently came to know how ANSI-C quoted strings can be used to give colourful prompts to commands that do not recognize escape characters. For e.g.
% read -q $'val? \e[31mFoobar\e[0m:' ...
1
vote
1
answer
47
views
sql escape sequence "\_", leetcode problem 1517
Problem: To find valid e-mail.
A valid e-mail has a prefix name and a domain where:
The prefix name is a string that may contain letters (upper or lower case), digits, underscore '_', period '.', and/...
-1
votes
1
answer
52
views
Disable escaping XML text passed through command line
General overview
I have a part of a XML file that comes from outside the XML (or the xslt itself) cause it's dynamically generated by another process. So I give it through the command line.
The ...
0
votes
0
answers
35
views
Error: Unable to parse JSON, Kotlin REST Json Payload contains escaped double quotes
I am facing one issue. The application is Kotlin + Java. I am calling a Kotlin REST Resource passing the escaped backslash in the payload (This request is coming from external client). but I am ...