I know there is the perl regex that is sort of a minor de facto standard, but why hasn't anyone come up with a universal set of standard symbols, syntax and behaviors?
Hello,
My string contain a lot of HTML entities, like this
"Hello <everybody>" there
And I want to split it by HTML entities into this :
Hello
everybody
there
Can anybody suggest me a way to do this please? May be using Regex? Thanks so much.
I need a regular expression for a list of numbers in a text box with carriage returns and line feeds, but no other characters.
e.g.
1234
5678
5874
3478
I have this:
Regex(@"\d\r\n${0,}?");
... but it is accepting commas when I paste them into my text box:
e.g.
1234,
5678
5874,
3478
Can someone please tell me what I'm doing wrong?
Thanks
I'm having a string where i'm using some placeholders to replace it with some values based on an object.
It is like the following:
Hello User <#= UserName #>
I need to replace the <#= UserName # with a value.
How can this be done with a regex? Please help. I dont want a string replace solution. There are somany placeholders and hardcoding the <#= UserName # and replace with the value is pointless
Suppose you have a string: "SELECT * FROM TABLE WHERE column1 = :var1 AND column2 = :var2"
Now, how do I get an array with all the variables like so:
Array
(
[0] => :var1
[1] => :var2
)
I've tried it with PHP's preg_match_all, but I struggle with the regex.
$varcount = preg_match_all("/ :.+ /", $sql, $out);
i need to download page from source code..for example
Cellini's Italian Restaurant
i want to download the "/len/aaproximat...php"..i didnt find the suitable regex for it..and i need to download that page..can anyone help?
im using vb.net
Hi, I have a string like this String str = "la$le\$li$lo".
I want to split it to get the following output "la","le\$li","lo". The \$ is a $ escaped so it should be left in the output.
But when I do str.split("[^\\\\]\\$") y get "l","le\$l","lo".
From what I get my regex is matching a$ and i$ and removing then. Any idea of how to get my characters back?
Thanks
I am reading a file that sometimes has chinese and characters of languages other than english.
How can I write a regex that only reads english words/letters?
should it just be /^[a-zA-Z]+/ ?
If I do the above then words like eété will still be picked but I don't want them to be picked:
"été".match(/^[a-zA-Z]+/) => #nil good I didnt want that word
"eété".match(/^[a-zA-Z]+/) => #not nil tricked into picking something i did not want
Hey.
I have a large amount of log data that I need to get some relevant information out of.
The syntax is:
WORD1 some text KEYWORD some text WORD2 WORD1 some text KEYWORD some text WORD2 WORD1 some text KEYWORD some text WORD2 WORD1 some text KEYWORD some text WORD2
Would it be possible to use regex to get a certain block out of it - so that when I queried some keyword it would return WORD1 some text THIS_KEYWORD some text WORD2
PS: There could be multiple instances of one keyword, it should return all of the blocks (preg_match_all, PREG_SET_ORDER?).
Hi,
I want to extract the status from the string untill I found a timespan. My input is something like "Something in start but not with this keyword of sure. STATUS: My Status Is Here Which can be anything but timespan 23:59:01 and so on. I want to extract the string after STATUS: untill 23:59:01 is found. How can i achieve this through regex. this 23:59:01 is a timespan and it is always in this format hh:mm:ss
my pattern is the following:
{(code)}
where code is a number (up to 6 digits), or 2 letter followed by a number.
For example:
{(45367)}
{(265367)}
{(EF127012)}
I want to find all occurrences in a long string, I can't just use pure regex , because I need to preform some action when i find a match (like logging the position and the type of the match).
I want to extract email addresses from a large text file. what is the best way to do it?
My idea is to find '@' in the text and use "Regex" to find email address into substring at (for example) 256 chars before this position and length of 512.
P.S.: Straightforwardly I want to know the best and most efficient way to find some pattern (like email addresses) in a huge text.
Hi,
I'm wondering how facebook extracts the right picture of the article from a link? they ignore any icons, ads images, or other not related images, & they gives you the right image?
What technique/method they use? because i've tried to extract all images using a php regex but how to find the right one?
Thanks
I would like to split my strings in JAVA based on a regular interval, not on regex. This is what I have to split:
1 x3.1.105.41 1 -10
2 x4.1.105.41 0 -10
3 x12.1.105.41 0 -10
4 y3.1.105.41.19 1 0
5 y4.1.105.41.21 0 0
6 y1.1.105.41.23 0 0
7 y12.1.105.41.25 0 0
I would like to seperate each column. Currently, I use the strLine.spli function
Any help would be great!
Using Java have the source code of a webpage stored in a string. I want to extract all the urls in the source code and output them. I am awful with regex and the like and have no idea how to even approach this. Any help would be greatly appreciated.
I need to get a list of tags in a text, make their contents bold, and remove them. Can't figure out how to make it.
E.g. with the following input:
foo [b]bar[/b]
The result should be:
foo bar
I use the following code to extract the tags:
Dim matches = Regex.Matches(OriginalRich.Text, String.Format("(\[{0}\])(.*?)(\[/{0}\])", tag), RegexOptions.IgnoreCase Or RegexOptions.Compiled)
Any help would be appreciated.
Maybe it's just too late for me to do this, but I'm trying to replace a character between 2 string with regex in PHP.
Example string:
other | text [tag]text|more text|and more[/tag] end | text
My goal is to replace | with <br/> between [tag] and [/tag].
Tried with this, seems it wasn't that easy though:
/<td>(\|)<td>/gsi
Searched a bit, but couldn't make out an answer with the stuff I found.
Hope you can help, thanks
I am trying to check if a html document includes script tags that are not empty using regular expressions. The regular expression should match any script tag with a content other than whitespaces or linebreaks.
I have tried
<script\b[^>]*>[^.+$]</script>
but this regex only finds script tags with one space.
I need to split this line string in each line, I need to get the third word(film name) but as you see the delimeter is one big blank character in some cases its small like before the numbers at the end or its big as in front of numbers at front.
I tried using string split with(" ") regex, and also \t but get the out of the bounds error.
400115305 Lionel_Atwill The_Song_of_Songs_(1933_film) 7587
400115309 Brian_Aherne A_Night_to_Remember_(1943_film) 7952
Did anyone have the same problem?
I need to validate phone number in PHP. I have made following regex, but I also need to it to accept numbers starting with plus char, how can I do that?
^[0-9]$
I have string like this:
"Some standard text CONST_INSIDE_QUOTES" blah blah CONST "There might be another quotes"
The thing is, that i want to replace all constants in string with some text, but it mustn't be applied on constants inside text in quotes. I have this regex:
sed "s/([A-Z][A-Z0-9_]*)([^a-z])/<span class=\"const\"\1<\/span\2/g"
which of course works for all consts. Any ideas how to exclude its apply on quotes constants? Unfortunately sed only...
I am attempting to write a regular expression to process a string of key value(s) pairs formatted like so
KEY/VALUE KEY/VALUE VALUE KEY/VALUE
A key can have multiple values separated by a space.
I want to match a keys values together, so the result on the above string would be
VALUE
VALUE VALUE
VALUE
I currently have the following as my regex
[A-Z0-9]+/([A-Z0-9 ]+)(?:(?!^[A-Z0-9]+/))
but this returns
VALUE KEY
as the first result.
Dear all,
I want to use index on table where i m searching a string using regex '^searchkeywordname$|searchkeywordname' ,this is scanning whole table .how can i retrieve fast result using index or sumthing
Every week I have to do the same report for my bosses. Our bug tracker sends us emails, and to be sure I caught everything I often need to search Outlook for all the bug email's I've received. If I could search the email subject using a regular exrpession, my life would be much easier.
Can I search my inbox using a regular expression in Outlook 2003?