find regular expression named group [closed] - regex

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

Related

Regex match every occurance and wildcard condition [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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.
Closed 8 years ago.
Improve this question
How can I write a regex that will match the following conditions:
Where every instance of the occurance 'eVar7=' contains the following 'unav'
This should be false:
;AA;;;;eVar7=nr_unav,;AA;;;;eVar7=br_unavail,;AA;;;;eVar7=sugg,;AA;;;;eVar7=sugg,;AA;;;;eVar7=sugg
and this should return true:
;AA;;;;eVar7=nr_unav,;AA;;;;eVar7=br_unavail,;AA;;;;eVar7=nr_unav,;AA;;;;eVar7=nr_unav11,;AA;;;;eVar7=nr_unavasdfasdferwgf
This regex does the opposite. If there is a match means that you don't want it:
eVar7=(?![^;]*?unav)
It uses a negative lookahead. Meaning that after the eVar7 match there should not be something with "unav" in the middle. If so, it matches.
This is just to put you on the right track however as there are a lot to consider with your examples. For example where exactly should this "unav" pattern exist. What characters are allowed between eVar7 and "unav" etc. Feel free to change the regex to suit your needs.

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}$/

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

Extract the email address, and replacing a character using Regex [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 am trying to come up with Reg ex expression that would match an email address starting with format E- and replacing the "AT" with an actual "#" sign.
Here is an example:
E-CANAD.JACK AT EXAMPLE.COM.
The desired output will need to look like CANAD.JACK#EXAMPLE.COM.
Replace:
[eE]-([a-zA-Z0-9]+(?:[._-][a-zA-Z0-9]+)*) (?:at|AT) ([a-zA-Z0-9]+(?:[._-][a-zA-Z0-9]+)*[.][a-zA-Z]+)
By:
$1#$2
More:
Visualization by
Debuggex
Demo by RegExr
You didn't mention your language, so I'm assuming perl
s/^E-(.*) AT (.*)$/$1\#$2/;

Regex extracting tokens from a dot delimited string [closed]

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: ([^.]*)\.[^.]*$.