Welcome,
Guest
. Please
login
or
register
.
October 23, 2024, 06:37:21 AM
News:
tastyspleen.net has a new discord server:
http://discord.tastyspleen.net
Home
Forum
Help
TinyPortal
Search
Calendar
Login
Register
tastyspleen::quake 2 community
»
Forum
»
The Tech Junkie Boards
»
0x1337c0de
»
interactive regular expression tool
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: interactive regular expression tool (Read 2359 times)
quadz
Loquaciously Multiloquent Member
Posts: 5352
Rated:
interactive regular expression tool
«
on:
January 25, 2009, 02:19:34 AM »
Hola!
Pretty slick interactive tool for experimenting with regular expressions:
http://www.rubular.com/
Note: though it claims to be tailored toward ruby regular expressions, unless you get into the more esoteric features, ruby regexps are compatible with perl regexps (which are compatible with grep -E or sed).
So don't worry--if you don't currently know the difference between ruby/perl/grep/sed regexps, then what you learn here will most likely be applicable across the board.
Also -- pretty nice example of dynamic HTML on that site...!
Regards,
Logged
"He knew all the tricks, dramatic irony, metaphor, bathos, puns, parody, litotes and... satire. He was vicious."
reaper
Opulent Member
Posts: 2872
Nice night for a walk, eh? - Nice night for a walk
Rated:
Re: interactive regular expression tool
«
Reply #1 on:
January 26, 2009, 12:53:12 PM »
You could also use something like editpad pro so when you build the regex it highlights all the matches.
Here's matching an IP:
\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
\b apply regex on word boundry
\. matches on the literal period, the . will be there in decimal form ip to separate the four bytes
but matching on d{1,3}\. will only verify there is 1 to 3 digits then a period, so it will match 999.999.999.999 , and an ip cannot go passed 255 for the value of each byte since the whole ip address is base2 32 bits.
the patterns inside the paranthesis gets applied to match 0-255 ..[0-5] match a single digit 0 through 5 after 25 before the . in a word boundry. The ? matches the preceding character zero or more times. Then you can write them more efficient, and i'm not quiet sure how that works.
Then there is passing the parameters via the bash shell.
anything in the ' quotes is literal except \ when followed by a $ for variables or backticks for embedding a command or something like that, where data between " does expand variables and what not.
Well something like that
«
Last Edit: January 27, 2009, 11:43:06 AM by reaper
»
Logged
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy
[BTF]Sigma
Phenomenally Prodigious Member
Posts: 3059
Rated:
Re: interactive regular expression tool
«
Reply #2 on:
January 26, 2009, 11:06:39 PM »
Brain =
Logged
reaper
Opulent Member
Posts: 2872
Nice night for a walk, eh? - Nice night for a walk
Rated:
Re: interactive regular expression tool
«
Reply #3 on:
January 27, 2009, 08:14:55 AM »
The regular expression can be applied by something like a utility (egrep) that shows lines in a file that match the pattern. Certain characters in the expression have special meaning.
Like.
. = any one single character, but only one
the \ makes the character afterwards a literal character "\." is a real period
*,?, [ ] , (), {}, ^, and $ have special meaning to. like ^ is the start of what you apply the regex to, and $ the end.
«
Last Edit: January 27, 2009, 09:22:38 AM by reaper
»
Logged
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy
Print
Pages: [
1
]
Go Up
« previous
next »
tastyspleen::quake 2 community
»
Forum
»
The Tech Junkie Boards
»
0x1337c0de
»
interactive regular expression tool
El Box de Shoutamente
Last 10 Shouts:
Costigan_Q2
October 17, 2024, 06:31:53 PM
Not activated your account yet?
Activate it now! join in the fun!
Tom Servo
October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
|iR|Focalor
October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
rikwad
October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.
Costigan_Q2
October 09, 2024, 01:35:05 PM
Et tu rikwad?
Please don't feed the degenerate lies of a sexually-perverted devil-worshipping barking dog like Focalor.
rikwad
October 09, 2024, 09:23:42 AM
https://tenor.com/en-CA/view/it-is-maam-angry-gif-13236696
RyU
October 09, 2024, 07:21:23 AM
lol
Been here since 2006
But I don’t mean you personally
By you I meant WE all suck at Q2
I guess I was just trying to be funny …
Costigan_Q2
October 08, 2024, 06:16:31 PM
Who the fuck are you?
Stop feeding degenerate lies, there are too many liberals and commies in this filthy rotting husk of a gaming community as it is.
RyU
October 08, 2024, 06:18:00 AM
whether you want to be a man a woman, a women that wants to be a man, a man that wants to be a woman,
a broom,
a mop,
Or even a horse,
Just know you still suck at Q2 ..
RyU
October 08, 2024, 02:38:09 AM
Some funny shit
Show 50 latest
User
Welcome,
Guest
. Please
login
or
register
.
October 23, 2024, 06:37:21 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search
Advanced search