regex Questions

3

Solved

The section 3.4 Using Bracket Expressions of GNU awk manual, reads To include one of the characters ‘\’, ‘]’, ‘-’, or ‘^’ in a bracket expression, put a ‘\’ in front of it. For example: &nbsp...
Foreigner asked 2/11 at 14:38

2

I`m looking for a way to create an inspection rule in Intellij that identifies when there are inline comments and moves them to their own line above. Example: Find someCode() // someComment and...
Loon asked 16/9, 2015 at 12:1

5

Solved

Is there a way to match repeated characters that are not in a sequence? Let's say I'm looking for at least two 6s in the string. var string = "61236"; I can only find quantifiers that ma...
River asked 16/1, 2014 at 16:17

2

I'm trying to grab 2 items from a simple line. [Title](Description) EDIT: actually a url looking to display called it description because i want it displayed not actually parsed. [Trivium](ht...
Detraction asked 29/10, 2015 at 2:40

6

Solved

I'm trying to parse a sort of big SQL script containing commands like create functions and store procedures. I want to split the file in strings whenever I find a GO statement (I want to execute it...
Hydrocellulose asked 23/2, 2012 at 17:22

7

Solved

I am working on a project where I need to make a function that will parse the 4 default math operations (addition, subtraction, multiplication, division). It would be nice if the function could par...
Hydrophobia asked 27/4, 2011 at 11:56

2

Solved

Hi i'm using laravel and I want to validate create a regex which will allow a specific format for duration (not time as this can exceed a 24 hr format). so for example 124hrs 30 mins and 24 secs wo...
Zealous asked 21/11, 2015 at 22:50

3

I would like to replace two carriage returns (\n\n) with a carriage return and a tab (\n\t) in Google Docs (regular document NOT a spreadsheet). If I enter \n\t in replace with the simple text, as ...
Coheir asked 28/11, 2016 at 23:22

3

Solved

I'm trying to split street name, house number, and box number from a String. Let's say the string is "SomeStreet 59A" For this case I already have a solution with regex. I'm using this fu...
Laudatory asked 30/3, 2021 at 8:17

6

Solved

I've been trying to work this out for almost an hour now, and I can't see myself getting much further with it without any help or explanation. I've used regex before, but only ones that are v...
Chane asked 14/5, 2018 at 12:17

5

Any pages with page type posts, order type posts, or posts show this error. This is only visible on a hosted environment. I cannot replicate the errors locally I have done the following in this or...
Gabriel asked 11/9, 2019 at 1:42

8

Solved

I'm trying to get trim off trailing decimal zeroes off a floating point number, but no luck so far. echo "3/2" | bc -l | sed s/0\{1,\}\$// 1.50000000000000000000 I was hoping to get 1.5 but some...
Akilahakili asked 4/5, 2015 at 15:21

3

Solved

I am using the Swift Package Manager, with Swift 5.7.1. I would like to compile code with a regex literal. For example, main.swift could be as follows: let message = "Hello, world" print(...
Jitterbug asked 26/2, 2023 at 17:7

2

In R, I have some rather unusually formatted strings in a data.frame column that I would like to split by commas (i.e., each element of the column is a string of individual values separated by comm...
Ectropion asked 23/9 at 13:29

5

Solved

I want to validate a 12-Hours time format like (01:05 PM) in PHP, Javascript and HTML. I tried this: ((([1-9])|(1[0-2])):([0-5])(0|5)\s(A|P)M) But I don't know why it doesn't work.
Bohemia asked 27/2, 2016 at 8:40

2

Solved

I would like to add some type of validation to my QInputDialog. I use the input of the dialog to create a file system path. So I would like to exclude characters such as @$#%^&*() but keep - an...
Glantz asked 8/11, 2013 at 17:56

7

Solved

I have a path: path = foo/bar/baz and I would like to determine what the base is. In this example it should return "foo". There are a few ways I have tried: root = re.search('(.+?)/(.+)', pat...
Thermic asked 18/12, 2012 at 19:43

2

Solved

I have a ID variable that comes from 35 different hospitals, so has varying different arrangements of the variable, and sometimes it has the same root ID number with a secondary line number - e.g. ...
Enigmatic asked 13/9 at 3:20

8

Solved

I have multiple lines of text in log files in this kind of format: topic, this is the message part, with, occasional commas. How can I split the string from the first comma so I would have the t...
Plumbo asked 25/5, 2011 at 21:30

4

Solved

I want to rename a_1.0.tgz to b_1.0.tgz, since 1.0 may be changed to any version number, how can I achieve that? For example, I can use mv a*.tgz b.tgz if I don't need to keep the version nu...
Hindi asked 12/7, 2016 at 9:7

5

Solved

I need validate with RegEx an sexagecimal value, for example: 24° 12' 55,4" or 32° 24' 15,4". For now, I have the next RegEx, that matches successful with degrees and minutes: ^([0-8][0-9]|[9][0]...
Kay asked 19/8, 2013 at 19:40

4

I have a file that has newlines and then some line extension that I need to unwrap. Example: X123 + a b c + d e f g Y4567 + a1 b2 + c1 d2 + e1 f2 Expected: X123 a b c d e f g Y4567 a1 b2 c1 d2 e1 ...
Jeffers asked 26/8 at 22:30

4

I'm using the JPA CriteriaBuilder to select entities of type MyEntity from a MySQL db as follows: String regExp = "(abc|def)" CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery query = cb...
Kosiur asked 28/7, 2014 at 13:1

2

Solved

I need to find in files (xml) date in this format 2021-06-25T21:17:51Z and replace them with this format 2021-06-25T21:17:51.001Z I thought about using regexp with sed but back references does not ...
Olympus asked 24/1, 2022 at 18:29

2

Solved

I've got a string: s = ".,-2gg,,,-2gg,-2gg,,,-2gg,,,,,,,,t,-2gg,,,,,,-2gg,t,,-1gtt,,,,,,,,,-1gt,-3ggg" and a regular expression I'm using import re delre = re.compile('-[0-9]+[ACGTNacgtn...
Gestation asked 20/8 at 17:18

© 2022 - 2024 — McMap. All rights reserved.