|
Carlos | Posted at 7:27am on Monday, August 27th, 2007 |
Very usefull |
Carlos | Posted at 7:31am on Monday, August 27th, 2007 |
Why this regex "^-\(w+)" does not retreive enything from here "-lolo",
Thank you very much |
Perlfect | Posted at 7:35am on Monday, August 27th, 2007 |
Carlos, the backslash should be before the "w+", not the parenthesis. Your regex should read "^-(\w+)", without the quotes. |
Eddie | Posted at 12:51pm on Tuesday, September 11th, 2007 |
I put (/w+) in your tutorial running on \fredupperlower/clipped/file.txt and it matches /clipped, which I want it to. But in my script, it's not working. The sequence is:
$dir = $File::Find::dir;
$dir =~ /(/w+)/;
$dirname = $1;
print "directory name: $dirnamen"; |
Eddie | Posted at 1:16pm on Tuesday, September 11th, 2007 |
I tried using:
$dir =~ m!/(w+)!;
and that seemed to work (better than I expected, since it returns "clipped" instead of "/clipped" which is easier to work with for my purposes). |
Agus | Posted at 10:19am on Thursday, September 13th, 2007 |
I need your, how to validate phone number. eg: (021)087655 or 021-56745.
thanks |
Sleve | Posted at 6:53pm on Monday, September 24th, 2007 |
Agus: (d{3})d{6} or
d{3}-d{5}
I forget how to make it so that "either" will grab the line.
(((d{3})d{6})|(d{3}-d{5})) should have done it, I think, but it failed to catch the second one in capture groups. |
Sleve | Posted at 6:56pm on Monday, September 24th, 2007 |
Agus: I put it in correctly, but the comment engine stripped out some back slashes. There should be a backslash before each parenthesis in the first one listed. |
Kokok | Posted at 12:30am on Thursday, January 10th, 2008 |
This page is great to test my regex |
Siidheesh | Posted at 11:03pm on Friday, October 24th, 2008 |
Now that my regex, (TEXT|MATH)[_](.+)[(](.+)[)], is working correctly, how do I enclose the regex in an 'if' statement to test a variable against it and get the $1, $2 and $3 variables. |
Karyn | Posted at 8:38am on Monday, November 17th, 2008 |
Excellent - saved me a lot of time from running the script, changing the regexpr, running it again, re-changing the regexpr etc. Thanks! |
Dennis | Posted at 9:32pm on Wednesday, December 31st, 2008 |
Question: How do I validate the 'regular expression' itself before using it? I have an application that allows users to enter regular expressions to 'mask' data and it blows up if they enter an invalid regular expression. Would like to check the regex first for validity to prevent it from blowing up the script when it is actually used... Thanks in advance, Dennis |
thyme | Posted at 10:45am on Tuesday, January 13th, 2009 |
Which regular expression can I use to extract the FOUR-DIGIT number in the text "my name is mgt, I have 1234 at someplace"
Please help!!! |
Score_Under | Posted at 1:25pm on Thursday, January 15th, 2009 |
@Thyme:
bd{4}b |
Score_Under | Posted at 1:25pm on Thursday, January 15th, 2009 |
Sorry, it filtered the backslashes. There was a backslash before the "b", "d" and other "b". |
soger | Posted at 11:05am on Sunday, January 18th, 2009 |
Dennis: to validate a regular expression you can do something like this:
eval {''=~/$user_regex/};
if ($@) {
print "Invalid regular expression: $@";
} else {
do_something($user_regex);
} |
alper | Posted at 10:17am on Wednesday, February 4th, 2009 |
better than other online regex tools.. only thing is the text limit in box. is it really accepting only 36 characters ot is it my browser? |
Steven the Easily Amused | Posted at 10:25am on Monday, February 16th, 2009 |
Really Nice... just wish I could have a longer string as alper noted above. |
vobb | Posted at 10:25am on Monday, February 23rd, 2009 |
Nice. Simple, effective and visual. |
Nandu | Posted at 10:08pm on Sunday, April 26th, 2009 |
I need a clarofication for the following:-
For Input :cathatcatcat
Case 1)the regex ^(c|a|t|h)+$ results in the last "t" being matched
BUT
Case 2)^(c|a|t)+$ results in 0 matches
In (case 1) and (case 2) shouldn't the first "c" get matched?Please explain.. |
kuddus | Posted at 9:51am on Monday, May 4th, 2009 |
fine |
Scott | Posted at 12:40pm on Thursday, May 7th, 2009 |
Thanks for the tool. It helped me to study for my final! |
Benit | Posted at 10:21am on Tuesday, June 2nd, 2009 |
I want to capture the first occurrent of AND in the following statement :
C:/Test/AND/Check/Run_AND/AND.exe
I want to replace from C: to first occurrence of AND by some other path.
Please help me. |
Anonymous | Posted at 4:54pm on Thursday, June 11th, 2009 |
This is great tool. Thanks for making it available. I have one feature request: I'd like to be able to test regex expressions larger than 40 characters. |
keith | Posted at 6:12pm on Wednesday, June 17th, 2009 |
Nandu: In the first case, your regex is saying "match if the first character of the input is 'c' or 'a' or 't' or 'h' and every subsequent character is one of those characters, and the last character is one of those characters. So your result matches (bold) for all characters in the first case, and the group (in green) ends matching the last character t.
In the second case, the first character is in the group, but with 'h' omitted, when it gets to the 'h' in the input, it fails and there is no match.
In other words, your regex is saying: match if the input is a string of characters made up of any combination of one or more of the characters in the group from beginning to end. |
LCB | Posted at 2:31am on Wednesday, July 1st, 2009 |
How I can get the string:
11x-A-20 (ST)
1as-50tdt
(Atx-220)
The string can vary from numbers and letters, and combine hyphens (1,2,3,n or none) and parenthesis...
from this lines:
1 11x-A-20 (ST) 831771.8700
1 1as-50tdt 831771.8700
1 (atx-220) 831771.8700
I tried several regex but have no luck to catch it at all
anyone had any idea how to catch the string part of this? |
test | Posted at 6:44pm on Thursday, July 23rd, 2009 |
Awesome tool |
Yash | Posted at 7:44pm on Tuesday, July 28th, 2009 |
Thanks, it sorted out my stuff |
Jess | Posted at 11:24am on Wednesday, August 5th, 2009 |
WOWW!!!! SUPERB!!!!!!! it precisel;y told me wher i went wrong!!!!! |
FarmnerGiles | Posted at 2:54pm on Friday, August 7th, 2009 |
LCB: Try (d) ([dw-s()]*) d*.d* |
BlueINK | Posted at 8:41am on Monday, August 10th, 2009 |
LCB This Also Works
[0-9]s(.*)s[0-9]+ |
Blueink | Posted at 8:54am on Monday, August 10th, 2009 |
wierd it auto removed the backlashses
there should be backlash behind the s's which mean Space |
Anonymous | Posted at 3:04am on Friday, August 21st, 2009 |
very use ful |
femilopsy | Posted at 1:30pm on Monday, September 14th, 2009 |
please i tried the regex (LA/09A).*(s)(T) to match that a string starts with LA/09A/.
please tell me where i have gone wrong |
Dmytro | Posted at 4:21pm on Thursday, September 17th, 2009 |
Very useful tool! The only suggestion it would be prefect if you allow longer strings for regex. Thanks guys! |
chuck | Posted at 12:44pm on Thursday, October 1st, 2009 |
very nice |
Nicholas | Posted at 9:21am on Friday, October 16th, 2009 |
the minimum character length is quite restrictive. |
Nicholas | Posted at 9:21am on Friday, October 16th, 2009 |
the minimum character length is quite restrictive. |
Nicholas | Posted at 9:22am on Friday, October 16th, 2009 |
oops, i meant max... |
rohit | Posted at 12:28am on Saturday, October 31st, 2009 |
thanks |
Emil | Posted at 8:00pm on Sunday, November 8th, 2009 |
brilliant |
perlsgerl | Posted at 5:36pm on Saturday, November 14th, 2009 |
very useful tester. thanks |
uderman | Posted at 6:09pm on Friday, February 26th, 2010 |
Very usefull, thank you! |
Terziyski | Posted at 7:29pm on Wednesday, March 31st, 2010 |
Very useful indeed ! |
kevin | Posted at 1:17am on Friday, April 2nd, 2010 |
i'm having some trouble with this.
i have a string 'HASH(0x1f1c6950)'and i only want 0x1f1c6950.
can somebody please help me with this one because i'm very new at this.
thank you |
CarlyKim28 | Posted at 10:36pm on Saturday, June 26th, 2010 |
All people deserve wealthy life and personal loans or secured loan can make it better. Because people's freedom bases on money state. |
passer-by | Posted at 9:37pm on Friday, July 2nd, 2010 |
You might want to consider expanding the regex field's text input limit.
My regex statement got truncated due to this limit.
^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}$ |
JWellington | Posted at 9:16pm on Friday, July 9th, 2010 |
Ok, I got a string of text, for example: "725.50 87.50 541.50"
I am trying to make sure that each string has at least two instances of .50, why is this not working?
m/.50{2,}/g
I've even tried: m/.{2,}/g
It still does not work. Please help. |
Andrew | Posted at 5:41am on Wednesday, July 14th, 2010 |
For those who want to type strings longer than 40 chars, use this greasemonkey script.
// ==UserScript==
// @name Bigger regex textboxes
// @namespace http://com.example
// @include http://www.perlfect.com/articles/regextutor.shtml
// ==/UserScript==
var form = document.getElementById("regextutor");
if (form) {
var inputs = form.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
inputs[i].setAttribute("size", 80);
inputs[i].setAttribute("maxLength", 500);
}
} |
Comments to date: 49.