regex Expressions in Rules
for example Aaacasfafa-ssafafafafafafafafasahfgf
What rules are used to delete - all the characters that follow
Index_title.modify {replace (type = regex) | - (?<=-) [a-zA-Z0-9] |} is ineffective
regex Expressions in Rules
for example Aaacasfafa-ssafafafafafafafafasahfgf
What rules are used to delete - all the characters that follow
Index_title.modify {replace (type = regex) | - (?<=-) [a-zA-Z0-9] |} is ineffective
Brought to you by Jan van Straaten
Program Development - Jan van Straaten ------- Web design - Francis De Paemeleere
Supported by: servercare.nl
why didnt u use separator when u scrubbed it?
index_title.scrub {single(separator="-" include=first)|[your title scrub]}
or with regex afterwards(like u asked)
index_title.modify {remove(type=regex)|"^[^-]*(-.*)$"}
^ - start form beginning
[^-]* - zero or more of any character thats not a -
(-.*)$ - whats to be removed,in this case...a real - and everything afterwards to the end of the element
the beginning and ending " are delimiters,all regex expression need to be enclosed in them(when using type=regex).
Examples of AAAA (dasadsa) gdggf (1) fafafaf
Need to delete and replace the last occurrence of () content should be written regex
not sure what u mean?
u want to delete (1)?
its it always a number inside (x)?
element.modify {remove(type=regex)|"(\s\(\d+\))[^\(]*$"}
\s - a space
\(\d+\) - one or more numbers inside ()
[^\(]*$ - start from the end