Regex extracting tokens from a dot delimited string [closed] - regex

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am trying to find regex expressions that will accomplish the following
Given sample string: This.is.my.sample.string
1.) I need a regular expression that will get me only This
2.) I need another regular expression that will get me only is
3.) I need another regular expression that will get me only my
4.) I need another regular expression that will get me only sample
5.) I need another regular expression that will get me only string
So basically I need 5 different regular expressions to get all 5 delimited strings.
Is it possible?
Thanks in advance.

This: ^([^.]*), string: ([^.]*$), is: \.([^.]*), my: \.[^.]*\.([^.]*), sample: ([^.]*)\.[^.]*$.

Related

regualr expression letters and word match [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
apologies for what is probably a really simple question but I am a complete noob when it come to using regular expressions.
I am trying to create an expression that matches some set criteria together, and although I can find the code to validate these things separately I'm struggling to understand how you put it all together.
What I am looking for is an expression that validates an entered code:
It will always a start with either OR or TR and then you will have 6 digits after that e.g. TR002563
Any help would be greatly appreciated.
Try this regex:
/^(?:O|T)R[0-9]{6}$/
You can use this regex:
/^[OT]R[0-9]{6}$/

How to start a RegEx statement at the 2nd position of a string [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a string
.HACK G.U. VOL. 1 REBIRTH
I'm using a tool that allows me to specify a RegEx statement that can be used in a replace operation.
I want the RegEx to find all the periods "." that start after the 1st position. The replace operation should return the following.
.HACK GU VOL 1 REBIRTH
Thanks
The following will do the trick:
(?<!^)(\.)
per http://rubular.com/r/w1apzTZLPk
Since Javascript doesn't support negative lookbehind, this can't be done in Javascript, but there are alternatives as discussed in http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript
One approach in this case would be to capture the previous character and replace it with the same content as part of the replacement process, as in:
(.)(\.)
Note: You don't need to use a capture group for the matching of the literal . in either of the above. I just used that technique to highlight the match in Rubular.

find regular expression named group [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
In my previous question how to find Regular expression named groups, I asked the regular expression for pattern
//input var: x(length),y(width),z(height)
If pattern will be changed like
//input var: x(length in cm),y(width in cm),z(height in cm)
Then what will be the regular expression for this?
what will be the change in this line
Dim extractIndividualInputsRegex As New Regex("(?<input>\w+)\((?<meaning>\w+)\)")
I tried
Dim extractIndividualInputsRegex As New Regex("(?<input>\w+)\((?<meaning>.*)\)")
Try the following:
Dim extractIndividualInputsRegex As New Regex("(?<input>\w+)\((?<meaning>[\w\s]+)\)")
The (?<meaning>[\w\s]+)\) will match a combinations of space and word characters inside the ( and ) which should be enough.
Regex Hero Demo
Try this:
(?<input>\w+)\((?<meaning>\w+) in (?<unit>\w+)\)
Shown on regexr: http://regexr.com?36oss
Or, if you want all three words in meaning group, try:
(?<input>\w+)\((?<meaning>\w+ in \w+)\)
Shown on regexr: http://regexr.com?36osv

regex match anything between {esbmsg:header:xxxxxx} [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
How to match anything between {esbmsg:header: and }
like xxxxxx could be any string {esbmsg:header:xxxxxx}
Try with:
{esbmsg:header:([^}]*)}
Where [^}]* matches everything that is not } character.
Try this regex
{esbmsg:header:(.*)}
It will also allow you to have any character in value.
Well, if you want to capture only the content of your expression (the "xxxxx" part) the best approach is to use positive look ahead:
(?<={esbmsg:header:)[^}]+
Depending on how your content looks you might have to tweak the [^}] part. For further information on regex (or a detailed explanation of the expression above) I recommend the following:
Regex reference
Regex tutorial

regular expression to match the same character being typed with different style [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm looking for a simple regular expression to match the same character being typed with different style, like : احمد - أحمد إحمد - آحمد
the word has a char that could be typed in different form.
thank you in advance.
You can use the following expression to match: احمد - أحمد إحمد - آحمد
/[\x{627}\x{625}\x{623}\x{622}]\x{062D}\x{0645}\x{062F}/u
I assumed you are using PCRE flavor, if you are using a different flavor then you should look how to specify Unicode code points using your flavor and what modifiers you need to pass the regular expression engine so it can deal with Unicode.
Regex 101 Demo