06 Dec 2018 05:08 PM - last edited on 30 Sep 2022 01:11 PM by MaciejNeumann
Hi team,
I have an application that I am trying to get the usernames out of the <title> tag.
I am using the JavaScript variable expression type with the "docment.title" variable. this results in grabbing page titles that have the username at the end.
Agile Product Lifecycle Management - Welcome , INCDSYPRD01
INCDSYPRD01 is an example of the usernames I am trying to grab.
I tried a few different times at getting just the username, but I admit I am not the greatest with Regex.
Does anyone have a cleanup rule that might work at just getting the username?
Thanks,
Adam Sjoerdsma
Solved! Go to Solution.
06 Dec 2018 06:37 PM
Hi Adam,
If i understand good, you want to find username from page tittle. Please let me know that this username always look the same?
If the username looks like you provided in the example, you can use this regular expression:
(INC[a-zA-Z0-9]+)
Radek
06 Dec 2018 06:44 PM
You can test your expressions here: https://regex101.com
06 Dec 2018 08:13 PM
We actually want to be able and grab any potential username from the statement. From my understanding this will always be one word that can be any combination of characters or numbers.
06 Dec 2018 08:26 PM
For usernames, there is always a common schema. You must then adjust the regex to find it. If you use the name you gave in the forum, you have a ready-made regular expression above.
07 Dec 2018 09:54 AM
Hi Adam,
If you want to catch any possible username, and your title will always follow the convention of Welcome , <username> at the end of the string, just use:
Welcome , (.*)$