Extract the email address, and replacing a character using Regex [closed] - regex

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/;

Related

Get value out of string with a regular expression [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 9 years ago.
Improve this question
Regular expressions are driving me nuts. Let's say I have this string:
rid=1234567"
How do I get the value 1234567 out of this string? And that number can be anything, with any length, but also characters and numbers.
With a capture group
=([1-9a-zA-Z]*)"
Debuggex Demo

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 to match colon and numbers [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 writing regex to match the pattern like this.
abc:123-12-4
abc: It should be exact match including colon
123 Number match any length
- Exact Match
12 Number Match any length
- Exact match
4 Exact match
Any ideas how it can be done in a simpler way.
You can use this regex:
^abc:[0-9]+-[0-9]+-4$

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