Regex for slash followed by any number [closed] - regex

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
What would be the correct way of writing a regex that states:
/ followed by any number
For example, gets fired with "/1", "/2", but not "/a" etc.

PCRE
/\/\d/
this will match any '/' followed by any single character number number.
/\/\d+/
this will match '/' followed by any set of consecutive numbers.
/^\/d+$/
this will match '/' followed by any set of consecutive numbers that are the only thing on that line.

Related

How do I write a Regex pattern to match the following strings? [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 string that could come in several forms
“PSM000216556880035450088|TRF”
“VNM000216556880035450088|TRF FROM MACK”
“NXG000216556880035450088”
“Transfer from josh SL000216556880035450088 to jack”
“X00000216556880035450088 0098123 TRANSFER 789121”
I need a Regex pattern that could get the string that starts with PSM, VNM, NXG, SL00 or X00.
i.e. in 1, I need “PSM000216556880035450088”. This string is the reference and it is what I need. It can be found in any position in a sentence and sometimes the reference might not be separated from the other words by a space. Sometimes a special character can be used as a separator. i…e. in 2 “VNM000216556880035450088|TRF FROM MACK”.
I will be using the Regex in my VB.NET code.
What about this with multiline flag?
((?:PSM|VNM|NXG|(SL|X)00)\d+)

Regex: check if string corresponding Word numbering list style [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'm looking for regex-way to find if a string matches any of this pattern:
2.
1.2
3.4.5
These numbers are taken from the numbering list of Word.
If you only want to match what is above, use ^((\d\.)+\d|(\d\.))$. (Link to regex tester).
This will either match that first kind of pattern (with a digit and then a period) or the other two, which have a digit followed by a period more than 1 time, and another digit at the end.
If you also want to match patterns like 3.4., i.e., strings that may or may not end in a period, you can use ^(\d\.)+\d?$ (Link)
This matches patterns that have a digit followed by a period one or more times, and then maybe a digit after that.

Regex to match letters and digits except 6 digit long number [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
Can someone tell me how to allow in Regex all a-zA-Z0-9 except 6 digits long number?
So true for:
1234567
a123456
123456P
3A237bdb8
but false for
123456
I want to
allow only letters and digits
deny 6 digit long number (like 123456) and other not letter characters like -_+,.!##$ etc.
If your regex engine supports lookahead, you can use:
^(?!\d{6}$)[a-zA-Z0-9]+$
Demo

Regex matches string#substring [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 am looking for a regex matches any string in the following format:
string#substring -> where substring = substring of the string and string is only letters from a to d
e.g.
abcddd#cd accepted
abcddd#cccc not accepted
This regex should meet your requirements:
[a-d]*?([a-d]+)[a-d]*#\1
It matches abcddd#cd but doesn't match abcddd#cccc.
Depending on your choice of tool and how you use it, you may or may not have to anchor it with a ^ and $ at the beginning and end respectively (turning it into ^[a-d]*?([a-d]+)[a-d]*#\1$).
Experiment here.

Regex: extract value from double quotes [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 4 years ago.
Improve this question
having a hard time to find regex solution.
The value in database's field "product_id" can be in either format:
{"value":"e19f2b3e-9919-421e-a125-95fdd989459d"}
{"itemUuid":"8fe2a09e-aade-485c-b847-e83a780f1b8e"}
Need to write a regex capturing BOTH cases, so the result will be:
e19f2b3e-9919-421e-a125-95fdd989459d
8fe2a09e-aade-485c-b847-e83a780f1b8e
What I already did (in Vertica syntax) is
trim(TRAILING '"}' from regexp_substr(me.value, '[0-9].*'))
which doesn't capture the id if it starts with alphabetic character.
You can use the RegEx (?<=:").+(?="})
(?<=:") makes sure there is :" before your match
.+ matches any char at least once
(?="}) makes sure there is"} after your match
Demo.