Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

If requesting help, make sure to mention what game you are attempting to use ACT with.
For the best FFXIV support, join Ravahn's Discord Server. Also check out OverlayPlugin's FFXIV FAQ and Setup Guide.

Need help with simple Regex

I'm using ACT to parse the log file of Project Gordon

For guild posts the log file has this format:
26-01-14 02:16:50   [Guild] CrashinOut: what up
26-01-14 02:16:55   [Guild] CrashinOut: oh hey Ziplok
26-01-14 02:16:59   [Guild] CrashinOut: how the hell are you


There's a date and time of fixed widths, then a TAB.. Then the literal string [Guild], the player's name, a colon, a space, then the message.

What regex can I use to extract the $player and $message, which also making sure it's a [Guild] message
I've tried everything I can think of and can't get it to work.

I've tried the following, and it's valid in regex101.com:

^.{18}\[Global\]\s+(?<Player>\w+):\s(?<Message>.*)

After further investigation, it seems ACT is not parsing this regex token correctly

\[Global\]

Which is supposed to parse the literal string [Global] and it's not.

Comments

  • I'll have to take your word for it that what you pasted was supposed to have a tab.  To me it looks like 3 spaces.

    Your target says Guild but your regex says Global...  so that's what wasn't working to me.

    I went with this to go with either collection of whitespace:
    ^.{17}\s+\[Guild\]\s+(?<Player>\w+):\s(?<Message>.*)

    Lastly, if you're using Custom Triggers, timestamp prefixes might get stripped unless you tell ACT not to in misc options.

  • It's deffo a tab, which gets stripped when posting here. I'm going to be using this for both [Guild] and [Global] and I mixed them up when posting. Either one will work and I can swap when neede. 

    It's still not working. Even if I have just use:
    \[Global\]
    It doesn't trigger. But it does with other keywords consistently. I'm not sure ACT is using the \[ and \] correctly, but I'm guessing now.

    It's not behaving at all like Everquest 2's log parsing.

    I don't see anything about timestamp prefixes in Options-> Miscellaneous ?



  • ACT just uses the .NET Regex class directly.  The syntax you're using looks compatible.

    The default timestamp length for EQ2 is 39 characters.  If whatever you're using is not overriding that to 18 and you don't use the checkboxes I mentioned, then you won't get the log line you expect in Custom Triggers.

    I really don't know what your environment is or what you're trying to do for sure... so all I can do is throw out wild ideas.
  • Selecting both of those timestamp checkboxes fixed everything. Thanks!
Sign In or Register to comment.