Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


View this topic in a long page with up to 500 replies per page Create new topic
1 | 2 | 3
BDFL - Memuneh
58496 posts

Uber Geek
+1 received by user: 9939

Administrator
Trusted
Geekzone
Subscriber

  Reply # 1413194 24-Oct-2015 14:37
Send private message

You can't notify yourself ;)





gzt

8878 posts

Uber Geek
+1 received by user: 1185


  Reply # 1413198 24-Oct-2015 14:58
One person supports this post
Send private message

Cool. Is it excluded from quote blocks? That could get annoying.

 
 
 
 


6682 posts

Uber Geek
+1 received by user: 2108

Subscriber

  Reply # 1413201 24-Oct-2015 15:15
Send private message

gzt: Cool. Is it excluded from quote blocks? That could get annoying.


would think so as i needs the @ symbol before the username

Minimalist
5351 posts

Uber Geek
+1 received by user: 343

Moderator
Trusted
Subscriber

  Reply # 1413202 24-Oct-2015 15:16
Send private message

Got it!

gzt

8878 posts

Uber Geek
+1 received by user: 1185


  Reply # 1413203 24-Oct-2015 15:24
Send private message

Quote test:

freitasm: Testing with @sbiddle, @tonyhughes, @scottjpalmer... Did you get this message? [Again?]




2546 posts

Uber Geek
+1 received by user: 299

Trusted
Subscriber

  Reply # 1413204 24-Oct-2015 15:26
Send private message

Yeah but a quote of a mention will have the @ symbol so will trigger another mention




My views (except when I am looking out their windows) are not those of my employer.

2062 posts

Uber Geek
+1 received by user: 224

Trusted

  Reply # 1413205 24-Oct-2015 15:30
Send private message
2062 posts

Uber Geek
+1 received by user: 224

Trusted

  Reply # 1413206 24-Oct-2015 15:32
Send private message

Oh just read you can't notify yourself lol




505 posts

Ultimate Geek
+1 received by user: 50

Trusted
Internet by Design

  Reply # 1413212 24-Oct-2015 16:19
Send private message

Adding matching whitespace on either side takes care of the email matching, but will mean that if people miss a space it won't match

\s\@(\w+\b)\s

OR 

\s\@(\w+\b)

Depending on if you want to match whitespace on both sides or just infront.

If ASP VBscript doesn't support \s for whitespace, you can escape a normal space too with "backslash space"






2546 posts

Uber Geek
+1 received by user: 299

Trusted
Subscriber

  Reply # 1413214 24-Oct-2015 16:21
Send private message

Thanks Daniel, I wouldn't imagine people missing aspace would betoo much of a problem.

Cheers, Matt.




My views (except when I am looking out their windows) are not those of my employer.

BDFL - Memuneh
58496 posts

Uber Geek
+1 received by user: 9939

Administrator
Trusted
Geekzone
Subscriber

  Reply # 1413217 24-Oct-2015 16:50
Send private message

danielfaulknor: Adding matching whitespace on either side takes care of the email matching, but will mean that if people miss a space it won't match

\s\@(\w+\b)\s

OR 

\s\@(\w+\b)

Depending on if you want to match whitespace on both sides or just infront.

If ASP VBscript doesn't support \s for whitespace, you can escape a normal space too with "backslash space"


I tested in dev and it matched a word after the @ and stopped a the first non-character - period, space, etc. So will just leave it there...

Thanks again!





BDFL - Memuneh
58496 posts

Uber Geek
+1 received by user: 9939

Administrator
Trusted
Geekzone
Subscriber

  Reply # 1413220 24-Oct-2015 16:57
One person supports this post
Send private message

Another few of things:

 

  • Notifications aren't sent out if edit a post - adding a @ AFTER you posted won't trigger the emails. In this case is better to add a second reply for example
  • Early on we accepted usernames with non alpha/number characters, so there's a nic.wise for example (Hi Nic!). To make sure we filter bad stuff the function will obviously look for alpha/numbers that form a valid user name, using the same validation function as the registration page. So nic.wise will never get a notification...
  • More than one mention of a username in a single post triggers one email notification only




468 posts

Ultimate Geek
+1 received by user: 135

Subscriber

  Reply # 1413236 24-Oct-2015 17:40
One person supports this post
Send private message

Try: (?:^\@([^\s]+))|(?:\s\@([^\s]+))

(still with modes ig)

This allows for mentions at the start of the message, or anywhere else with whitespace beforehand. This eliminates matching on email addresses etc. [^\s]+ matches any non-whitespace character, so names such as @some.person will match, or a real example of @*jono* will match.

Edit: This would match @bob: with "bob:".. Working on that at the moment.


Edit2: Whether this following one works depends on the implementation of regex. It needs to have lookbehinds. This is obviously a little more complicated and maybe less performant, but alas here it is,

(?:(?<!\w)\@((?:[^\s:,.](?:\.[^\s:,.])?)+))

I think this will cover most use cases. Allows any character in name except for the following: ":" ";" "," and any more than one period in a row. This is so that you could still do @person: @person; @person.. @person... etc.




'That VDSL Cat'
6259 posts

Uber Geek
+1 received by user: 1172

Trusted
Spark
Subscriber

  Reply # 1413257 24-Oct-2015 17:58
Send private message

now this will certainly be a handy feature!




#include <std_disclaimer>

 

Any comments made are personal opinion and do not reflect directly on the position my current or past employers may have.


468 posts

Ultimate Geek
+1 received by user: 135

Subscriber

  Reply # 1413269 24-Oct-2015 18:42
Send private message

Rappelle: Try: (?:^\@([^\s]+))|(?:\s\@([^\s]+))

(still with modes ig)

This allows for mentions at the start of the message, or anywhere else with whitespace beforehand. This eliminates matching on email addresses etc. [^\s]+ matches any non-whitespace character, so names such as @some.person will match, or a real example of @*jono* will match.

Edit: This would match @bob: with "bob:".. Working on that at the moment.


Edit2: Whether this following one works depends on the implementation of regex. It needs to have lookbehinds. This is obviously a little more complicated and maybe less performant, but alas here it is,

(?:(?<!\w)\@((?:[^\s:,.](?:\.[^\s:,.])?)+))

I think this will cover most use cases. Allows any character in name except for the following: ":" ";" "," and any more than one period in a row. This is so that you could still do @person: @person; @person.. @person... etc.



It stopped letting me edit, so FYI I forgot to actually add the semi colon in there. What you want is

(?:(?<!\w)\@((?:[^\s:;,.](?:\.[^\s:;,.])?)+))

1 | 2 | 3
View this topic in a long page with up to 500 replies per page Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

D-Link NZ launches professional Wireless AC Wave 2 Access Point for businesses
Posted 17-Aug-2017 19:25


Garmin introduces the Rino 700 five-watt two-way handheld radio
Posted 17-Aug-2017 19:04


Garmin announces the Foretrex 601 and Foretrex 701 Ballistic Edition for outdoor and tactical use
Posted 17-Aug-2017 19:02


Brightstar announces new distribution partnership with Samsung Knox platform in Australia
Posted 17-Aug-2017 17:07


Free gig-enabled WiFi network extends across Dunedin
Posted 17-Aug-2017 17:04


Samsung expands with connect Gear S3 Frontier
Posted 17-Aug-2017 15:55


Fact-checking Southern Cross Next cable is fastest to USA
Posted 17-Aug-2017 13:57


Thurrott says Microsoft Surface is dead last for reliability
Posted 16-Aug-2017 15:19


LibreOffice 5.4 works better with Microsoft Office files
Posted 16-Aug-2017 13:32


Certus launches Cognition
Posted 14-Aug-2017 09:31


Spark adds Cambridge, Turangi to 4.5G network
Posted 10-Aug-2017 17:55


REANNZ network to receive ongoing Government funding through to 2024
Posted 10-Aug-2017 16:05


Chorus backhaul starts with 2degrees
Posted 10-Aug-2017 15:49


New Zealanders cool on data analytics catching benefit fraud
Posted 10-Aug-2017 09:56


New Zealanders wary of wearable biometrics: Unisys
Posted 9-Aug-2017 09:39



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.