GREP Expression for Varying Text
I have an index in which I'd like to Find/Change all the entries with a character style, but stop the GREP expression before the tab, leader, page numb. They vary though. Here are 3 indexed examples:
A16T-PVUNL-3
A-100-90-3CT-300
B-20-22-50-3/4 shank
Is there any way to constrict this to just the characters and digits, then stopping before the tab? I achieved it in another index whose entries are 7-digits only with this expression: ^(\d+)
The return constricted it so that search did not find the page numbers after the tabs.
Thanks.
http://help.adobe.com/en_US/indesign/cs/using/WSE33E49F9-94CE-4043-AA51-4761408A63F4a.html #WS6F1E524C-8F74-4331-A813-33D08F983E94 is the official help page.
You'll find a bunch of other resources listed here: http://community.adobe.com/help/search.html?searchterm=Nested+Styles&q=Nested+Styles&lbl=i ndesign_product_adobelr&x=0&y=0&area=0&lr=en_US&hl=en_US
Similar Messages
-
Errors trying to apply a Boolean expression for conditional text
I have been trying to create some Boolean expressions to filter conditional text, with mixed results. The Boolean expression is three conditions separated by ORs followed by four conditions preceded by AND NOTs. When I apply the expression, FrameMaker exhibits and error and has to quit. The numbers in the error message are:
9004, 4908044, 6134440, 5459515
The hidden log file appears to be nothing more than a stack dump.
Do the numbers listed above indicate anything?
Are there any known limitations on how long a Boolean expression can or should be? One expression with one fewer OR worked.
Does there need to be a space between an AND and a NOT? The builder does add one, so I assume it is not necessary.
Does anyone have some general rules of thumb when working with Boolean expressions for conditional text?
Thanks,
VanVan,
The error values are meaningless to users. However, please do send the logfiles to the [email protected] address.
As far as conditionals go, the general rules are that conditon names must be quoted and that if your ar using the NOT, it must run together with the AND or OR, e.g. ANDNOT ORNOT.
There's an articel in the Developer Connection on using the boolean operators at http://www.adobe.com/devnet/framemaker/articles/fm8_single_sourcing.html
Perhaps if you posted the condition that caused the crash, someone might be able to spot an error. -
Need a regular expression for the text field
Hi ,
I need a regular expression for a text filed.
if the value is alphanumeric then min 3 char shud be there
and if the value is numeric then no limit of chars in that field.[0-9].
Any help is appriciated...
thanks
bharathi.Try the following in the change event:
r=/^[a-z]{1,3}$|^\d+$/i;
if (!r.test(xfa.event.newText))
xfa.event.change="";
Kyle -
Regular expressions for replacing text with sms language text
Hi, I'm trying to write a function which converts normal, correctly spelled text into the shorter sms language format but struggling to come up with the regular expressions i need to do so, can anyone help?
1: remove surplus white space at the beginning of a sentence and at the end of a sentence.
e.g. " hello." --> "hello." OR "hello ." --> "hello."
2: remove preceeding and/or proceeding space if there's a word then a number possibly followed by another word
e.g. "come 2 me" --> "come2me" OR "dnt 4get" --> "dnt4get"
3: remove "aeiou" if word starts and ends with "!aeiou"
e.g. "text" --> "txt"You can make the whitespace on either side optional: text = text.replaceAll("\\s*(\\d)\\s*", "$1");1. Use String's trim() method.
3. This one has to be done in two steps: import java.util.regex.*;
public class Test
public static void main(String... args) throws Exception
String text = "The quick brown fox jumps over the lazy dog.";
System.out.println(devowelize(text));
public static String devowelize(String str)
Pattern p = Pattern.compile(
"[a-z&&[^aeiou]]++(?:[aeiou]++[a-z&&[^aeiou]]++)+",
Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(str);
StringBuffer sb = new StringBuffer();
while (m.find())
m.appendReplacement(sb, m.group().replaceAll("[aeiou]+", ""));
m.appendTail(sb);
return sb.toString();
} -
Grep expression for specific search within Brackets
Hello,
I did a search and found many topics for searching within brackets, but wasn't able to find anything to search for specific characters/quotation within brackets.
Note: The forum image uploader wasn't working for me so I embedded it to the topic. Hopefully it shows up for you. (http://cl.ly/1H42302P2x3c1Q3P2a42)
For the Brackets and words within, i use: (\[).+?(\])
and have it them to a different font.
For my project i need the quotations to be a different color and nothing else.
These are the ones i'm trying to add to an expression: '|"|;|,
Any help is very much appreciated. I've been trying many arrangements with no luck. Thanks!It's not possible to search for your punctuation inside parentheses only. (FYI, that needs a positive lookbehind of variable length, and that's not possible.)
But the hint to get it done is right there:
function(){return A.apply(null,[this].concat($A(arguments)))}
For the Brackets and words within, i use: (\[).+?(\])
and have it them to a different font.
Simply search for your set
only in that particular font. -
I'm reposting this here, hoping some genius scripters will know more than the designers ---
I've scoured the websites and have been trying to figure out the correct GREP expression for what I'm trying to achieve, but to no avail, so alas I am posting this in hopes of ending my misery.
I want to add an italic character style to the names of Naval ships (USS xxx xxx) in my book. I want to italicize the name, but not the 'USS'. Any ideas?
Thanks a million.
~LaurieHere you go (needed a break). Write the names in a text file, one name per line, and save it in the scripts folder using the name uss_names.txt. The first line in that file must be the name of the character style you want to use. If that style doesn't exist, the script creates it.
Peter
if (app.documents.length == 0) exit ();
// Read the text file
ship_names = get_list ();
// Create character style if necessary
if (app.documents[0].characterStyles.item (ship_names[0]) == null)
app.documents[0].characterStyles.add ({name: ship_names[0]});
app.findGrepPreferences = app.changeGrepPreferences = null;
app.changeGrepPreferences.appliedCharacterStyle = app.documents[0].characterStyles.item (ship_names[0]);
for (i = 1; i < ship_names.length; i++)
app.findGrepPreferences.findWhat = "(?<=USS\\s)" + ship_names[i];
app.documents[0].changeGrep ()
function get_list ()
var f = File (app.scriptPreferences.scriptsFolder + "/uss_names.txt");
if (f.exists)
f.open ("r");
var temp = f.read ()
f.close ();
return temp.split (/[\n\r]/);
else
alert ("Can't find uss_names.txt.");
exit (); -
Help building a grep expression
hello,
pls can someone help me build a grep expression for a dictionary:
abcdef
hjtoku
yghmns
I need an expression that would find in each word where the underline starts, and put, lets say, an asterisk there:
abc*def
hjto*ku
ygh*mns
thank you in advance!Underlines are a character attribute, not a glyph, so there's not a lot of complexity to this. To find underlined characters search for .+ and in the find format section set the basic character attributes to underlined. Understand that this will find underlined characters anywhere, even at the start of the word. If you don't want that it's a lot more complicated and I haven't figured it out myself, yet.
To add the asterisk change to *$0
This will add the asterisk, but it will also be underlined, so you need to run a second search for \* (you need to escape the asterisk character in the search field to find a literal *) with the underline attribute and change to nothing, but change the attribute in the change format to no underline, or if you wanted to remove the other underlines as well it could be done in the first step by removing the underline attribute in the change formatting.
Peter Kahrel has a nifty script for chaining find/change queries to run in one step. -
Sales Order text for Variant Configuration
Hello
I have researched my issue and also have asked other peers for guidance. I feel that I am really close to getting my issue to work but I am not sure what I am missing, so I am hoping that someone can give me some advice as to what to check please. See below for the description.
My issue is in reference to SD Variant Configuration and is outlined below.
Overview
Main Unit is a radio test set
Test set can have an upgraded software
Example
Model 6015 u2013 standard test set
Model 6015T u2013 Upgraded software test set
Model 6015V u2013 Upgraded Software + test Set
Requirement
Use same Material Number using Variant Configuration for the upgrades
Price is to default to the Upgraded price
NOTE:
Our materials are already established and are set up as material type Finished Goods; ERLA item category; sales order item category is a copy of TAC. I am using a Configurable Material type KMAT, item category 0002 and linking to the FG material item category ERLA in the material master.
I have created the Material Variant (KMAT) in MM01
Created the characteristic in CT04
Created Classification in MM02 for material FG
Created Super BOM for Configurable Material in CS01 and added the upgrades as Alt Bom 2 for upgrade and 3 for Upgrade+. Also added the Alt BOM text
Created Profile of configurable material in CU41
For the Material I added the configurable material to MRP 3 screen in MM02
Created the BOM link in CS40
I simulate the material in CU50. I enter my material; select the icon for configuration, I can see the characteristic Value Assignment nad see my characteristics Description. I go to the value and use the drop down I then see the pop up of all the different values.
I have created Characteristic Reference VCSD_UPDATE_ARKTX with table VCSD_UPDATE and field ARKTX - no values
I have created a characteristic Test_Choice with the 2 values one is Test Upgrade 1 and the other is Test Upgrade 2. Both of these have the description as well.
For Material Text:
I have set up a reference characteristic using 30 character format (named VCSD_UPDATE_ARKTX),
with table name VCSD_UPDATE and field name ARKTX.
Then in the Configuration Profile(CU42) for configurable material, added a procedure(named PR_PRODUCT_DESCRIPTION) to the dependencies which contains code that sets the description
$self.VCSD_UPDATE_ARKTX = ''Test Upgrade 1u201D
If $self.TEST_CHOICE = Test_Upgrade_1,
$self.VCSD_UPDATE_ARKTX = ''Test Upgrade 2u201D
If $self.TEST_CHOICE = Test_Upgrade_2,
When Entering the sales order for Material Number XXXXXX, I receive a pop up that I can select which Alternate BOM (from CS02) I would like. I select my line item and then select the configuration icon at the bottom of the sales order. I see again my characterestics values (the same as CU50) but am unable to select the radio button. Not sure if this part is standard. Still no change in the sales order line item. I have validated that I am using a copy of the standard TAC item category. How does the text change to the correct value? Am I missing a seeting somewhere. Please provide any guidance with this as I have been trying to get this to work for over a month.
Thank you for your time. It is greatly appreciated.I have figured out that this will work if I go to the standard material (it is not KMAT but it is a FERT material type) and set the flag in the Material Master Basic Data 2 tab that this is a configurable material and not use KMAT material type for a super BOM. The text changes for this scenario so it give me hope.
This is not ideal, as I want to use the Super BOM because there are different variations (non stock items) that I need to pull through on the picking list in order to tell the end user which option needs to be loaded in the standard material. At least I know the text can change on the sales order; but I am still struggling with the use of the super BOM and changing the sales text when there is use of a super bom as you tie that to the MRP 3 screen of the FERT material type. I can set everything up, but the text will not change if I set up the material master this way. Guidance is appreciated.
Example
Material 72433 (FERT)
on sales order I enter 72433, my alternate BOM comes up with different Options. Alternate BOM 1 is standard configuration; My Alternate BOM 2 has Option 3 and 4 while alternate BOM 3 has option 5 and 6. Alternate BOM 2 is a 6015T and Alternate BOM 3 is a 6015V.
I want my sales order to pull through the text of 6015T or 6015V, whichever is chosen. I want my picklist to print out the option that was selected. -
What is the regular expression for the end of a story?
Forgive me if this is wrong forum for asking this, but I'm trying to use the Find command using GREP and I need to know the regular expression for the end of a story. (Or, the last character of a story.) Thanks in advance.
I'd try search for .\z (that's a dot in front) which ought to find the very last character in the story, and replace with $0 and your additional text.
You know you can use a keyboard shortcut to move your cursor to the end of any story, right? Ctrl + End on Windows, Cmd + End, I think, on Mac. Unless you want to do this to every single story in the document, I would think you might be just as well off to put your text on the clipboard, put the cursor in the story and hit the key combo followed by Ctrl/Cmd + V to paste. -
Need some help with GREP expressions
I know--KNOW--there's a way to do this, but my GREP expressions keep failing.
I want to add an em dash before any phrase that's in a paragraph style. So I obviously want the em dash to be in the location "beginning of paragraph." All my GREP searches keep failing. Can someone help?Adobe's implementation of "beginning of paragraph" is a tiny bit off from standard GREP (which, in itself, is less a set of hard & fast rules, but more like "guidelines"). Yes -- you can search for beginning of paragraph using plain ^, but you cannot use it with a replace operation.
The trick is to give InDesign something to look for. Search for
^.
(that's right -- one wildcard right after the start of a paragraph). You don't want to loose the character it finds, so replace with
~_$0
where the first 2 codes is your em dash and the last 2 are "the entire found text". That's your original wildcard-found character!
Don't forget to put your paragraph style in the Find Formatting box.
This workaround works around the implementation failure, because you indeed want to add something to existing text. Unfortunately, another fairly standard GREP to look for empty paragraphs -- ^$ -- doesn't work, because then you have no place for a wildcard character ... (and yes, you can use a hard return \r instead of either first or last code, but then it won't work at beginning or end of story). It's one of those things I hope to see corrected with CS5.
[Edit] Ha! Peter beat me to it but he made a typo. Besides, my story is longer. -
How to search for a text node with a particular value in an xml document with labview
supposing i have the following xml document:
<head>
<book>
<bookname>zio</bookname>
<author>dan</author>
</book>
<book>
<bookname>the spear warrior</bookname>
<author>britney</author>
</book>
<book>
<bookname>the beard</bookname>
<author>derrick</author>
</book>
</head>
i want to search for the author of the book "the beard" using for example the V.I Get first match of labview to access the the node with value "the beard" and then use Get next sibling V.I and Get node text content to get get the author of this book..so my question is how do i write the xpath expression for Get first match so as to access the node with bookname "the beard" instantyly? am trying to minimise the use of loops because they increase the time duration,..thank you (NB:i dont want to use Get all Matched V.I because it obliges me to use a loop in order to access the name derrick and this increases the time duration for my v.i)
Solved!
Go to Solution.Since it's all text, why not use a real quick Match Pattern (or Regular Expression, but you don't need that much power here), see attached.
Cameron
To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.
To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
LabVIEW Unit 1 - Getting Started
Learn to Use LabVIEW with MyDAQ
Attachments:
Two-stage match demo.vi 8 KB -
Creating a transaction code for variant type in se93
hai all,
i created transaction's for dialogue type and report type,now i am trying to create transaction for variant type. in that what we have to provide in transaction text box where the f4 functionality is provided for that text box.
could any one plz help me out.
Thanks in Advance.Hi,
U need to create transaction variant in SHD0 transaction before creation transaction by variant.
Go thru the following link carefully.
Certainly it will be helpful to you.
http://www.mortenhjorthnielsen.dk/Security/transactionvariants.htm
Regards
Vadi -
How can I apply a GREP style to a text variable?
Hello everybody,
I have a question concerning GREP styles inside Paragraph styles.
1. I've created a text variable to generate a recurring title on the upper side of the page based on the main title paragraph style;
2. The recurring title is in Adobe Garamond Small Caps, all letters in lower case, and it is formatted with a paragraph style sheet in the master page;
3. I want to create a GREP style for the recurring title, according to which every time that in the recurring title appear an apostrophe or the double quotes, they are automatically lowered 2pt on the baseline
(I already created the character style sheet that lowers letters of 2pt).
What I need is the correct GREP formula to automatically apply the character style sheet to apostrophes and double quotes, in the line of text generated by the text variable...
Thanks for your help
p.Hi,
As I said, using Power Headers is the best way to do it.
As Power Headers treats the header as "live text", you can use a simple grep style inserted in the header para style:
… to obtain:
For the sample, I use a char style named "-2pts" with Shift -5 pts and Green color to show you the place of ' and ".
Don't forget that, even Power Headers treats the header as "live text", you only have to update Power Headers to make an update of the headers!
Even I use in another cases Tomaxxi's [JS] and it's a good way to treat the question, Jean-Claude Tremblay's solution is less interesting because the variable used is converted in text. If the variable text content changes, it's more complicated to manage the update! -
How to give for a text field 'max+1' value instead of sequence .
HI All,
I have a requirement like ,
For my text field i applied sequence by using groovy expression.Now i need to change that to 'max+' value of table Grid and display in the text field. Can please suggest me how can i implement .(JDev 11.1.1.3 v)
Regards,
Sindhu.hi user,
if you want perform some increment operation . in auto means. donot prefer these thread given below..
there is lot thread of for creating sequence. based on the sequence it works perfect.
if i understud correctly means follow this
Increment operation // it perfoms some increment operation. not using sequennce.
button press
compliation problem // have a look at this
if cumes under cirumstance for multiple user on that scree or ui . probabaly this idea(max)or (some increment) will fails.
i i will prefer sequqnecs._
IN ADDITION INFO TO USER
JOHN SAYIGN EXACTLY
Edited by: Erp on Sep 25, 2011 9:46 PM -
Oracle Pl/Sql and Oracle Application Express for Beginners
Good day,
Have a prodigy that is strongly interested in oracle application express.Haven know that he will only do we in APEX if he is good in pl/sql and have some skills in html and javascripts.
For such person,what are the books that i can recommend for him,that will guide and assist him?Will be highly grateful if anybody can assist.Sc0tt wrote:
I think it also falsely gives the impression that one does not need to understand the database at all because Apex can do everything for you...This is why I echo Munky when he says that you need a solid understanding of data models and the database before attempting to build an application.
I absolutely concur with this view. When I first started using ApEx, I was basically given a user guide and told to get on with it :-) Subsequently, for the first 6 months or so, I built probably fairly lousy (but functional) apps until I got a better grasp of Oracle architecture.
That being said, SQL is an absolute must if you are going to work on a database. PL/SQL really should be learned as well because your application will be limited without it. CSS and Javascript and nice to have's, but they can be learned as you go. Since all of the api's are built in pl/sql, it would really hinder what you could do if you didn't know it.One resource I have found very useful is the good old 'Ant' book a.k.a. Oracle PL/SQL Programming by Feuerstein, et al. I have a well-thumbed 4th edition sitting on my desk at the moment - weirdly for a text book, rather a joy to read.
I personally found Jay-Lew's "Cost-based Oracle Fundamentals" a somewhat bitterer pill to swallow - tough on the way down but good for one's constitution!
Maybe you are looking for
-
How to retrieve the drive letter of the current directory with an applet ?
The subject says it all. I have this html file and when launched it should get the current drive's letter. This is how it's done in java, but I dunno how to make it in an applet version. import java.*; import java.io.File; public class test { public
-
Differences between Internal table with Occurs 0 and Field-Groups?
Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 whe
-
I wonder why CS6 is not complete when downloaded? Why should I have to download JBX? If needed it should be a part of Indesign. My Mac doesn't have a name of a file to open and download, so now I simply don't have CS6 and can't convert my book to Kin
-
SUBSTR function to extract an specific value
I have data like this in a columnn RA&(44)RC&(44)RF&(44)RJ&(44)RN&(44)RU RI&(44)RQ&(44)RR&(44)RS RQ&(44)RR&(44)RS RG&(44)RP I want to be able to ectract just the values RA,RC,RF ETC..ETC... I try substr does not work: SELECT SUBSTR(szcasup_activities
-
Hi experts Can any one guide me how to analyze the single level and multilevel price variance when using material ledger. In actual costing all variances will disapear. Please provide any useful tables to do this analysis.