Sponsored Content
Top Forums Programming Regarding a GREAT site for understanding and Visualizing regex patterns. Post 303038850 by Neo on Monday 16th of September 2019 12:21:32 AM
Old 09-16-2019
Thanks Ravinder,

I generally use various online REGEX checkers when when I am writing REGEX expressions, mostly REGEX for PHP code.

This is the first one I have seen that has the "visualization" done like this, thanks for sharing.

The REGEX checkers I like the best have always been the ones where we can cut-and-paste our text into the checker and then see
the resulting matches so we can easily test the input versus the output when debugging.

Next time I need a REGEX I will also try this visualization tool.

Thanks for sharing.
This User Gave Thanks to Neo For This Post:
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Understanding a regex

Hi, Please help me to understand the bold segments in the below regex. Both are of same type whose meaning I am looking for. find . \( -iregex './\{6,10\}./src' \) -type d -maxdepth 2 Output: ./20111210.0/src In continuation to above: sed -e 's|./\(*.\{1,3\}\).*|\1|g' Output: ... (4 Replies)
Discussion started by: vibhor_agarwali
4 Replies

2. Shell Programming and Scripting

Understanding regex behaviour when using quantifiers

# echo "Teest string" | sed 's/e*/=>replaced=</' =>replaced<=Teest string So, in the above code , sed replaces at the start. does that mean sed using the pattern e* settles to zero occurence ? Why sed was not able to replace Teest string. # echo "Teest string" | sed 's/e*//g' Tst string ... (6 Replies)
Discussion started by: chidori
6 Replies

3. Shell Programming and Scripting

Regex patterns

can someone please confirm for me if i'm right: the pattern: ORA-0*(600?|7445|4) can someone give me an idea of all the entries the pattern above will grab from a database log file? is it looking for the following strings?: ORA-0600 ORA-7445 4) (2 Replies)
Discussion started by: SkySmart
2 Replies

4. Shell Programming and Scripting

Need Quick help on Understanding sed Regex

Hi Guys, Could you please kindly explain what exactly the below SED command will do ? I am quite confused and i assumed that, sed 's/*$/ /' 1. It will remove tab and extra spaces .. with single space. The issue is if it is removing tab then it should be Î right .. please assist.... (3 Replies)
Discussion started by: Nandy
3 Replies

5. Shell Programming and Scripting

Need help understanding this Regex.

Hi everyone, This regex looks simple and yet it doesn't make sense how it's manipulating the output. ifconfig -a eth0 Link encap:Ethernet HWaddr 00:0c:49:c2:35:6v inet addr:192.16.1.1 Bcast:192.168.226.255 Mask:255.255.255.0 inet6 addr:... (2 Replies)
Discussion started by: xcod3r
2 Replies

6. What is on Your Mind?

Virtualized Cyberspace - Visualizing Patterns & Anomalies for Cognitive Cyber Situational Awareness

Our team just published this technical report on ResearchGate: Virtualized Cyberspace - Visualizing Patterns & Anomalies for Cognitive Cyber Situational Awareness ABSTRACT ACKNOWLEDGMENTS Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License This... (0 Replies)
Discussion started by: Neo
0 Replies
Data::Munge(3pm)					User Contributed Perl Documentation					  Data::Munge(3pm)

NAME
Data::Munge - various utility functions SYNOPSIS
use Data::Munge; my $re = list2re qw/foo bar baz/; print byval { s/foo/bar/ } $text; foo(mapval { chomp } @lines); print replace('Apples are round, and apples are juicy.', qr/apples/i, 'oranges', 'g'); print replace('John Smith', qr/(w+)s+(w+)/, '$2, $1'); DESCRIPTION
This module defines a few generally useful utility functions. I got tired of redefining or working around them, so I wrote this module. Functions list2re LIST Converts a list of strings to a regex that matches any of the strings. Especially useful in combination with "keys". Example: my $re = list2re keys %hash; $str =~ s/($re)/$hash{$1}/g; byval BLOCK SCALAR Takes a code block and a value, runs the block with $_ set to that value, and returns the final value of $_. The global value of $_ is not affected. $_ isn't aliased to the input value either, so modifying $_ in the block will not affect the passed in value. Example: foo(byval { s/!/?/g } $str); # Calls foo() with the value of $str, but all '!' have been replaced by '?'. # $str itself is not modified. mapval BLOCK LIST Works like a combination of "map" and "byval"; i.e. it behaves like "map", but $_ is a copy, not aliased to the current element, and the return value is taken from $_ again (it ignores the value returned by the block). Example: my @foo = mapval { chomp } @bar; # @foo contains a copy of @bar where all elements have been chomp'd. # This could also be written as chomp(my @foo = @bar); but that's not # always possible. submatches Returns a list of the strings captured by the last successful pattern match. Normally you don't need this function because this is exactly what "m//" returns in list context. However, "submatches" also works in other contexts such as the RHS of "s//.../e". replace STRING, REGEX, REPLACEMENT, FLAG replace STRING, REGEX, REPLACEMENT A clone of javascript's "String.prototype.replace". It works almost the same as "byval { s/REGEX/REPLACEMENT/FLAG } STRING", but with a few important differences. REGEX can be a string or a compiled "qr//" object. REPLACEMENT can be a string or a subroutine reference. If it's a string, it can contain the following replacement patterns: $$ Inserts a '$'. $& Inserts the matched substring. $` Inserts the substring preceding the match. $' Inserts the substring following the match. $N (where N is a digit) Inserts the substring matched by the Nth capturing group. ${N} (where N is one or more digits) Inserts the substring matched by the Nth capturing group. Note that these aren't variables; they're character sequences interpreted by "replace". If REPLACEMENT is a subroutine reference, it's called with the following arguments: First the matched substring (like $& above), then the contents of the capture buffers (as returned by "submatches"), then the offset where the pattern matched (like "$-[0]", see "@-" in perlvar), then the STRING. The return value will be inserted in place of the matched substring. Normally only the first occurrence of REGEX is replaced. If FLAG is present, it must be 'g' and causes all occurrences to be replaced. AUTHOR
Lukas Mai, "<l.mai at web.de>" COPYRIGHT &; LICENSE Copyright 2009-2011 Lukas Mai. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information. perl v5.12.4 2011-08-03 Data::Munge(3pm)
All times are GMT -4. The time now is 11:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy