261,140 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
1
answer
85
views
What are the minimum and maximum escape numbers supported in the regular expression? [closed]
I want to escape all numbers into characters in regular expression, but I don't know what numbers can be converted to what characters.
For example, I want to escape all the following numbers:
123円 ...
-5
votes
0
answers
61
views
Regex to extract number from US currency amount [closed]
I need a regex pattern to use to extract the numeric portion from a US currency amount.
Example: 1,234ドル.56
I should get: 1234.56
Closest regex I've come to is this: \d+(\.\d+)*, but if I try it on ...
Ahmad's user avatar
- 13.5k
0
votes
3
answers
195
views
PHP, $regex to obtain each URL of videos about $pattern
I try with some regex to obtain only the URL of all the videos about $pattern but my $regex not work (in this case $pattern = "Greta"):
$data = '<p><a href="https://www.youtube....
-4
votes
1
answer
137
views
Regex using qr/\Qstring\E/ vs. (map { qr/$_/ } ("\\Qstring\\E"))[0] [closed]
In an attempt to avoid switch /x for a complex regular expression, I tried to replace qr/string/ with the following expression:
(map { qr/$_/ } ("a more" . "complex regex"))[0]
As ...
1
vote
3
answers
200
views
How to use regex in R to shorten strings by one space
I have some old data files with a large number of writing errors. An example is attached below, where some of the numbers in the .dat file are 9 digits or characters long rather than the expected 8.
...
2
votes
2
answers
114
views
Valid regular expression pattern validation in XML
I have a string element in an XML schema that I would like to restrict to the extended Latin character set plus numbers, punctuation, whitespace, etc.
I have tried the following:
<xsd:pattern value=...
4
votes
2
answers
171
views
Regex - How do I check for digits 01 to 52 in filenames?
I have found the answer :-)
It is: ^ghf(0[0-9]|[1-4][0-9]|5[0-2])\d{3}[A-Z]{2}_v\d{2}.pdf$
I receive filenames from a client that are structured according to the following scheme:
ghf50001BE_v02.pdf
...
0
votes
4
answers
153
views
Reducing indentation of specific lines within 1 cell based on contents within line
Incoming with another VBA question.
I'm currently have data within a column that has many line breaks, but certain lines need to be only indented 2 spaces whereas certain lines need to be indented by ...
-1
votes
3
answers
101
views
sed outputs matching line twice
I want to delete all lines that end with OFF except if they contain override.
Input
1765193089 socket override DiningRoom/Socket/Work/state ON
1765206025 socket evening Hall/Socket/Lantern/state OFF
...
-4
votes
3
answers
199
views
Captures all domain names within a property SubjectAlternativeName
I’m trying to extract a specific portion of text and haven’t had success despite testing multiple patterns and looking at similar examples. After struggling for a while, I figured it was time to ask ...
2
votes
2
answers
146
views
Troubleshooting: A single regular expression matching nested braces usable for java and perl
I have a regular expression in an extension of java by florian ingerl
to parse a latex command,
\\\\DocumentMetadata(?<docMetadata>\\{(?:[^{}]|(?'docMetadata'))*\\})
but the important thing is ...
-2
votes
1
answer
130
views
How can I solve this problem of test difference?
As far as I understand, the difference between expected and actual one is NBSP (Non‐Breaking Space).
I don’t know how to remove this. It doesn’t get highlighted and cannot be found using CTRL+H (...
-2
votes
2
answers
141
views
Detect srt blocks that contain exactly one dash (-) using regex [closed]
I’m working with .srt subtitle files in PHP and I need a regex that finds blocks containing exactly one dash (They're regular hyphens (-), not minus signs) and it starts at the beginning of a line.
...
4
votes
1
answer
102
views
Regular Expression Complex Matching
I'm working on a php project and I need to extract some informations from strings like :
COROLLA CROSS (07/22>09/25<)
I tried different patterns without success, such as:
preg_match("/(?P&...
1
vote
1
answer
91
views
Excluding allowing apostrophe in regex doesn't work [duplicate]
I have this method:
func isNameValid(_ value: String) -> Bool {
let trimmed = value.trimmingCharacters(in: .whitespaces)
guard value == trimmed else { return false }
guard trimmed.count ...