simple regex question: SQL (extract values before space) [closed] - regex

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Data: Mumbai, India (June 8 2019)
using the below code I have extracted June 8 from above data:
Regexp_replace(Extract_Regexp("Mumbai, India (June 8)" ,r"\((.*)$"),r"\)(.*)","")
Then extracted 8 from "June 8" using below code:
Extract_Regexp("June 8" ,r"\ (.*)$")
Now I want to convert final output: 08/06/2019

this may be you get some idea.
[^\d ]+
Match value:
1. june
https://rubular.com/r/3OR5xSF1gE1rrt

Related

Merging broken lines [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 14 days ago.
This post was edited and submitted for review 14 days ago.
Improve this question
In a text with many lines in notepad++, some lines are unintentionally broken into the next line without an end point. I want to merge lines that are more than 10 characters long that do not end with a dot(.) with of regex. Also put a space between merged lines.
For example, the following text:
tttttttttt
aaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbb.
ccccccccccccccccc
dddddddddddddddddd.
Convert to:
tttttttttt
aaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbb.
ccccccccccccccccc dddddddddddddddddd.
I also tried the following regex code but it didn't work:
[^\.]\n

How to "extract" string before "-" but if the string itself can contain a "-"? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have list of packages like this (it's bigger than this):
accounts-qml-module-0.7-3
accountsservice-0.6.55-3
alsa-firmware-1.2.1-2
alsa-oss-1.1.8-3
alsa-plugins-1:1.2.2-2
alsa-utils-1.2.3-2
augeas-1.12.0-2
baloo-5.74.0-1
baloo-widgets-20.08.1-1
binutils-2.35-2
breath2-icon-themes-1.0.10-2
breath2-wallpaper-1.0.10-2
bridge-utils-1.7-1
brltty-6.0-11
cfitsio-1:3.49-1
clucene-2.3.3.4-11
colord-sane-1.4.4+9+g1ce26da-2
confuse-3.3-1
containerd-1.4.1-1
convertlit-1.8-10
cpio-2.13-2
cracklib-2.9.7-2
cronie-1.5.5-1
cups-2.3.3-3
cups-filters-1.28.3-1
cups-pdf-3.0.1-5
cups-pk-helper-0.2.6-4
debootstrap-1.0.123-1
dhcpcd-9.2.0-1
diffutils-3.7-3
ding-libs-0.6.1-3
discount-2.2.7-1
djvulibre-3.5.27-6
dkms-2.8.3-1.1
docbook-xml-4.5-9
docbook-xsl-1.79.2-7
I'd like to have:
accounts-qml-module
accountsservice
alsa-firmware
alsa-oss
alsa-plugins
alsa-utils
augeas
baloo
baloo-widgets
but I don't really know how to do since there are some packets that have a "-" dash inside and I'm very confused about how could I achieve this avoiding to do it manually...
Is there a bash "trick" to do it?
try this regex :
^.+?(?=-[\d.\-:+]+)
demo

Regex (Bigquery) get specific values from STRING [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have the STRING - TX1234XT batch 44, 1111ABCDEF
TX1234XT (Can be different length)
batch 44 (number can be different length)
ABCDEF (can be a different length, but always have 1111 at the start)
What I need is to generate two columns:
BatchNumber Name
44 1111ABCDEF
1 1111SAMPLE
999 1111Example
Starting point:
First is done:
REGEXP_EXTRACT(reference, r'1111[a-zA-Z0-9_.+-]+') AS Name
Second
- REGEXP_REPLACE(REGEXP_EXTRACT(reference, r'batch [0-9_.+-]+'),r'batch ','') AS BatchNumber
SORTED ^_^
I don't really know Google Big Query, but if you want to extract the batch number and the value at the end, you could go with this regular expression:
/^.*?batch\s*(\d+),\s*(1111.+)$/
(\d+) will capture your batch id.
(1111.+) will capture the value starting with 1111.
Example here: https://regex101.com/r/SJXmIV/2

How to get value inside '[]' using regex? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
**Hi, I have written regex. in here i want select only value insdie **
[buttonRouter, CheckBoxModule, RadioButtonModule, DropDownButtonModule, SplitButtonModule, SwitchModule, SharedModule, ProgressButtonModule]
Instead of this it select
imports: [buttonRouter, CheckBoxModule, RadioButtonModule, DropDownButtonModule, SplitButtonModule, SwitchModule, SharedModule, ProgressButtonModule]
My requirement, regex has to select values only inside imports: [value]
This regex should return only return the value part but still look for "imports: ":
(?<!:imports: )\[.+\]

How to detect the file format with it's content [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
If you open a *.gif file with notepad the file starts with GIF89
but for the *.jpeg files the first characters aren't something like GIF89
How can I detect that my file is *.jpeg with it's file first characters?
According to The JPEG File Interchange Format:
(After a 2 byte "SOI" marker...)
the next 2 bytes will be 0xFFE0
the next 2 bytes are unimportant for this detection
the next 5 bytes will be "JFIF" (including the null-terminator)