Jump to content

Welcome to FTB Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

Regex fail.


3 replies to this topic

#1
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

So there I was, trying to figure out a regex to automatically fix YouTube videos on the wiki. At some point I forgot to escape a vertical bar. The result was... interesting.

 

post-1969-0-47937900-1390338157.png

 

"...more frustration and disappointment than reward." Indeed.

Attached Thumbnails

  • RegexFail.png

  • ZL123 and Celestial Oblivion like this

#2
RZR0

RZR0

    Administrator

  • Operator
  • 1980 posts
  • IGN:RZR0
  • Modpack:Private Pack

When I'm writing regular expressions, I use the software RegexBuddy. It's very useful because it comes with tons of tools, including live matching, so you can test out your regex on some text whilst you're actually writing it. It's payed software though, but there's probably free alternatives around.



#3
ViperSRT3g

ViperSRT3g

    Advanced Member

  • Moderators
  • 212 posts
  • IGN:ViperSRT3g
  • Modpack:Unlisted Pack

I only learned of Regex earlier today because of xkcd... :s


Vanilla Server: vanilla.vipersrt3g.net
banner-13472.png
Snapshot Server: snap.vipersrt3g.net
banner-25377.png

#4
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

Well, I did get it fixed rather quickly. As I said, just a matter of escaping a vertical bar. What I have yet to find out is why a single vertical bar without anything else is treated as some kind of wildcard...

@RZR0: AWB has a "regex texter" built-in. It isn't live, you have to manually click "find" every time and it doesn't help you actually build the regex. But it lets you test it without potentially destroying a wiki article, which is enough for my purposes ;)





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users