06 Dec 2018
09:08 AM
- last edited on
30 Sep 2022
05:11 AM
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.
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
You can test your expressions here: https://regex101.com
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.
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.