GREP expression for the last line, followed by the column break

For all of you who read this, thank you for taking the time to help. I'm a noob to JavaScript and GREP expressions, so thank you for all your time and help with this.

I wrote a JavaScript script to help my company format some of our work more quickly. We have pre-made models with character Styles all implemented (body, header, BodyItalic) etc.

My script works almost perfectly to identify patterns and apply the correct character style.

However, my expressions do not work perfectly and last line of text in the text box (linked), which has a column break, do not get to the format.

This last line is always different depending on the document. So I can't put in the constants. They are always variable.

My current GREP expression is. + ~ M which, theoretically, should find any character who repeated one or more times and is followed by a column break. The problem is, he finds that the last two characters on the line which are followed by a column break.

for example

Tribute would be tribeTE

Eulogy would be EuloGY

etc etc.

As you can see, they are not always the same words and could even be a short sentence so I can't just look like some words.

I am trying to establish why the GREP expression does not. Maybe I use GREP evil symbols? I don't know, so any help would be appreciated.

Thank you in advance.

Scorpio

This column break thing seems bugy. I have no idea why only the last two characters are found. If I try to find an entire word with \w+, which does not work. I get results as weird if I try to \b\w+~M. the good news, is that InDesign is no crash, here.

However: There is no GREP to search a specific line, so I'm looking for a columnbreak and then for the line which belongs to the aware found:

app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat = "~M"; 
var found = app.activeDocument.findGrep();

if (found.length > 0) {
for ( var i = 0; i < found.length; i++ ) {
  var curFound = found[i];
  var curLine = curFound.lines[0]; 
  curLine.fillColor = app.activeDocument.swatches[4];
}
}

Tags: InDesign

Similar Questions

  • How can I access the recipient "subordinate" in the expressions for the participant to ApprovalTask generator type "by the expression" value?

    Hello

    How can I access the recipient "subordinate" in the expressions for the participant to ApprovalTask generator type "by the expression" value?

    I can access some details of the beneficiaries of the workload, but how to access direct subordinates?

    TIA

    Leo

    Well, as I said, if you need to get a list of all rollover (for whatever logic you have), making calls to IOM to find the list of users whose Manager is the person in your composite.

    Sorry if I am wrong again.

  • Regular expression for the format: 000-000 - 000000 000000

    Hi guys,.

    I need to validate the columns in a regular expression for the format of 000 000 - 000000 000000.

    For example - if the column contains a value such as "500 110 - 500044 000100" then it should return 'true' otherwise 'false. '

    Your timely help is well appreciated.

    Thanks in advance.

    Hello

    inDiscover wrote:

    Hi guys,.

    I need to validate the columns in a regular expression for the format of 000 000 - 000000 000000.

    For example - if the column contains a value such as "500 110 - 500044 000100" then it should return 'true' otherwise 'false. '

    Your timely help is well appreciated.

    Thanks in advance.

    If you want a regular expression

    REGEXP_LIKE (str

    {{' ^ {\d{3} \d{3}-\d{6} \d{6}$'

    )

    According to your needs.

    You don't need regular expressions for this.  It will be more efficient to use

    TRANSLATE (str

    '012345678'

    '999999999'

    ) = 999 999 - 999999 999999'

  • GREP Expression for text variables

    I have an index in which I would like to find/replace all entries with a character style, but stop the GREP expression before the tab, the leader, the numb page. They vary however. Here are 3 examples indexed:
    A16T-PVUNL-3
    A 100-90-3CT-300
    B 20-22-50-3/4 tail


    Is it possible to contract it at all the characters and numbers, then stopping before the tab? I got in another index which entries are 7 digits only with this expression: ^ (\d+)

    The return he tightened so that research has not found the page numbers after the tabs.

    Thank you.

    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 will 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

  • ORA-01438: value larger than the precision specified for the column '

    When inserting the different entries of cheaper products in this table PF_PRODUCT_VIEWS_PROFILE, I'm having this problem of "java.sql.SQLException: ORA-01438: value larger than the precision specified for the column '.»


    As I see it in the tables (desc pf4. PF_PRODUCT_VIEWS_PROFILE; & PFCA4 of ESCR. DCS_PRICE_LEVEL;), I see the accuracy for the price of the table PF_PRODUCT_VIEWS_PROFILE as NUMBER (12.7) & accuracy for the price of the table DCS_PRICE_LEVEL as NUMBER (19.7). There is therefore a difference in precision 7 units for the price in the PF_PRODUCT_VIEWS_PROFILE table that is causing this problem. So that would be the solution.


    Could you please post my comments, so that I can change the accuracy for the price of the PF_PRODUCT_VIEWS_PROFILE table.
    Need to confirm other columns in the table PF_PRODUCT_VIEWS_PROFILE does not exceed their precision values before making this change.

    Hello

    Ideally avoid data loss as you increase the length of the column as it really is. You have to worry about this in the case if you reduce the length. It is always better to be doubly sure, so also check other tables.

    see you soon

    VT

  • How to avoid the total general of the classic report when the column break is installed in the Apex

    Hi all

    I develop application using Oracle Apex 4.2.0.

    I created the classic report Page.

    That I have summarized a column by selecting the check box check sum for the column.

    His shows the Grand Total.

    Then I chose the columns to break to the first column.

    His show the total groupwise and total as well as great as image below.

    dc.jpg

    My requirement is

    Need to hide total(Total:)) GroupWise or total general. I need to show any a total, not both.

    How to do this?

    Thank you

    Su.GI

    Su.GI wrote:

    Hi, thanks for your response.

    I use theme - productivity Application - issue 26

    -Standard model

    Report - report of Standart for classic report model.

    The above CSS code where I want to use in the page or report or model region.

    Specify a static region ID for the report area and put the following CSS rule in the CSS Inline property page:

    #static-region-id .uReportStandard tr:last-child td {
      display: none;
    }
    

    where static-region-id is the ID specified for the region.

  • Help in regular Expression for the beaches of limitation

    Hi, I'm working on the provision of a text field is limited to dates, it's just a part of the code. I already have the validation of the dates, but I am now limiting what the user enters using a regular expression. This code works a little however, it does not limit me for example I can enter more than 2 digits, but then he limits based on the total amount allowable so for example 8 digits are allowed if I just type. I need to stop after 2 digits then have a - then 2 other numbers then one - and then followed by 4 digits. I tried to limit each section and grouping as well. Any help would be greatly appreciated. Thank you.

    It is in the format code and I am the appellant in the key sequence.

    function DateKS () {}

    var value = AFMergeChange (event);

    If (! event.willCommit) {}

    Allow only characters that match the regular expression

    Event.RC = /^([0]{0,1}[1-9]{0,1}|[_1]{0,1}[012]{0,1}) ([-] {0,1}) ([0] {0,1} [1-9] {0,1} |) [12] {0,1} [0-9] {0,1} | ([3] {0,1} [01] {0,1}) ([-] {0,1}) ([0-9] {0,4}) $/ .test (value);

    }

    }

    I decided that control for 100 and 400 was not necessary because this event does occur that all 400 years. But I'm working on it further and changed even more. Here is my code to work.

    function isLeapYear (year) {}
    year return % 4 = 0;
    }

    function checkDaysInMonth (day, month, year) {}
    daysInMonth var = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

    If (month = 2) {}
    If (isLeapYear (year)) {}
    daysInMonth [1] += 1;
    }
    }

    return daysInMonth [month - 1] > = day;
    }

    function checkDateFormat (dateStr) {}
    var errorMsg = ",
    maxYear = (new Date()) .getFullYear (),
    minYear = maxYear - 1,.
    match = dateStr.match(/^(\d{2})-(\d{2})-(\d{4})$/),
    months,
    day,
    year;

    If {(matches)
    month = parseInt (matches [1], 10);
    day = parseInt (matches [2], 10);
    year = parseInt (matches [3], 10);

    If (month < 1="" ||="" month=""> 12) {}
    errorMsg = "invalid value for the month: ' + matches [1];"
    } ElseIf (day = 0) {}
    errorMsg = "invalid value for the day:" + match [2];
    } else if (! checkDaysInMonth (day, month, year)) {}
    errorMsg = "number of days for invalid month: ' + match [2];"
    } ElseIf (year < minyear="" ||="" year=""> maxYear) {}
    errorMsg = "invalid value for the year:" + match [3] + "-must be between" + minYear + "and" + maxYear;
    }
    } else {}
    errorMsg = "invalid date format: ' + dateStr + ' \r\nPlease use format: dd-mm-yyyy ';"
    }

    return errorMsg;
    }

    function checkReceivedDate() {}
    var value = AFMergeChange (event),
    errorMsg = ";
       
    ignore control if the value is blank, because this field is not mandatory
    If (! value) {}
    return;
    }

    If {(event.willCommit)
    errorMsg = checkDateFormat (value);

    If (errorMsg) {}
    App.Alert (errorMsg, 0, 0, "error");
    Event.value = ";

    Returns false;
    }
    } else {}
    Allow only characters that match the regular expression
    Event.RC = /^(?:0) [1-9]? 1 [012]?) ? -? ( ? : 0 [1-9] ? | [12] [0-9]? 3 [01]?) ? - ? 2? 0? [0-9] {0,2} $/ .test (value);
    Event.RC = / ^ \d{0,2}-?\d{0,2}-?\d{0,4}$/.test(value);
    }

    Returns true;
    }

  • regular expression for the xml tags

    Dear smart people of the labview world.

    I have a question about how to match the names of xml text elements.

    The image that I have some xml, for example:

    Peter

    13

    and I want to match all of the names of elements, that is to say: no, son, grandson, age, regardless of any attribute have these items. There is a regular expression, I can loop, that can do this? (Something like "\<.+\> ". "") It is no good because it matches the entire xml string.) I'd really only two different expressions, one for the match start elements, e.g. and one for the correspondence of the elements, for example.

    Thanks for your help in advance!

    Paul.

    The site Of regular Expressions will be very convenient.

    They have some good tutorials on regexp with a demo of the XML tags:

    Here is a small excerpt:

    The regular expression <\i\c*\s*>matches an opening of the XML without the attributes tag corresponds to a closing tag. <\i\c*(\s+\i\c*\s*=\s*("[^"]*"|'[^']*'))*\s*>corresponds to an opening with a number any attributes. Put all together, <(\i\c*(\s+\i\c*\s*=\s*("[^"]*"|'[^']*'))*| i\c*)\s*="">corresponds to an opening with attributes or a closing tag.  (source)

    If you want advanced XML analysis I suggest JKI XML toolkit.

    Tone

  • expression for the child attribute

    Hello

    I am very new to SOA BPEL. I have a query regarding the reading of an attribute in a Switch box. Excerpt from the result of a Web service Input:

    -< ns2:DataAttribute Name = "UD_ERPROLE" >

    -ns2:ChildRow Action = "Add" >

    < ns2:ChildDataAttribute Name = "Name of the role of ERP" Type = "String" Value = "ERPAccountPayable" / >

    < / ns2:ChildRow >

    < / ns2:DataAttribute >

    Now to switch-case, I can have 3 situation:

    UD_ERPROLE is not NULL

    Action is Add

    Equal to ERPAccountPayable role name


    Here, what can be the expression for case 3 switch above?

    first a I do: bpws:getVariableData('requestDetails_OutputVariable','RequestData','/ns16:RequestData/ns16:BeneficiaryData/ns16:Beneficiary/ns16:Entity/ns16:DataAttribute/@Name')

    but it helped... any help appreciated.

    Hello

    Not sure what you mean here...

    UD_ERPROLE is not NULL

    It seems that UD_ERPROLE is a value for the Name attribute, so if you try to get the first DataAttribute where Name = "UD_ERPROLE", the expression would be...

    /NS16:RequestData/NS16:BeneficiaryData/NS16:beneficiary/NS16:entity/NS16:DataAttribute[@name = "UD_ERPROLE"] [1]

    See you soon,.

    Vlad

  • Displays the dates of diff using PL/SQL expression for the item "display only"?

    Hello
    I have a single display element -: P2_FROM_Date. If his game, Fri, sat or Sun I want to put the date of the last Monday date. If its Mon, Mar or sea, it must be this date of Monday.

    Ex: Today is Friday and last Monday was 18.
    So yesterday, today, tomorrow and Sunday, the date appear as June 18, 2012.
    Since Monday to Wednesday, the date has to be the next that is Monday, June 24, 2012

    I tried under 'Source' from the element using PL/SQL expression and the body of the PL/SQL function. Does not

    Can anyone help?

    Thanks and greetings
    Umer

    1. you must set 'used source' "Always".
    2 If you use a PLSQL function as source type body should set a 'RETURN' statement like this:

    declare
    lv_date number;
    begin
    select to_char(sysdate,'D') into lv_date from dual;
    if lv_date=2 then
      return to_char(sysdate-1);
    end if;
    end;
    

    Published by: mario1977 on June 27, 2012 11:44

  • Is there a control of the expression for the opening of a string?

    Hello

    Just curious, is there a control of the expression that allows a user to enter a string that could be read by the expression?  I don't see on the submenu Sub "> Effects options for expressions", but thought I would see if anyone has any ideas how to proceed without having to reference an external text file.

    Thank you for your time and help!

    -Laz

    Yes, it's possible, of course, and to make things even less intrusive, I couldn't access comment a layer attribute rather than rename them the current layer.

    But in my situation I am desirous of an AE to select artist in a closed set of channels.  I don't want to enter their own data for fear that there is something wrong with the formatting, etc.  I'd rather have a drop down of sorts for the selection.  Thus, creating null items in the project Panel, naming them with unique names, then dragging in the model and by applying an expression control 'Control of the layer' layer in quesiton, AE artist can choose one of these layers, and then my script can read the value of the control layer name.

  • I can't display the preview pane when opening for the column.

    When I open an Illustrator file I can't see my preview to column view (my favorite) pane. The preview pane appears to have expanded much more to the right so that no matter how wide, I do the window that I still cannot see the preview. I tried to drag the window beyond the size of my screen to see if there is a column separator after the panoramic overview I can move to the left to reduce the size of the preview pane, but it seems not to be. Any ideas on how to solve this problem? It is not critical, but boring.

    Please search the Forum. This has answered every week (at least) for the last year.

    Do not use column view. He broke. Use the display of the list. Select a file, and then press the SPACEBAR to preview. Work within dialog boxes.

  • How can I modify, move, add a column... Information for the columns to make a few changes of script?

    Hi Oracle Experts,

    I have a difficult question . Lets say that I have two table with the same name, but these two tables come from two different databases with 2 different users.

    A source database and the user SCOTT

    Table Column Data_Type Length PRECISION Scale Primary key Nullable Default Comment
    BOOKSBOOK_IDVarchar24--1---
    ISBN_10Varchar2

    13

    ---Yes--PRICENumber-62-Yes--

    Target database B and user DAVID


    Table Column Data_Type Length PRECISION Scale Primary key Nullable Default Comment
    BOOKSBOOK_IDVarchar220--1---
    PRICENumber-62-Yes--
    TITLEVarchar250---Yes--

    What I want to do:

    I want to get a query script that shows which columns need to edit, add and drop depends on the source table (make the necessary changes to make the columns in the Source table columns the same target table). No need to make any changes in the database do not want the query that must run to make these changes.

    EXAMPLE: I was using under query to get the query create table EMP. But seeing the column information to create the column even for the other user is difficult:)

    Select dbms_metadata.get_ddl ('TABLE', 'EMP') of double

    Erhan_toronto wrote:

    Is it possible to see the result like this:

    ALTER table Target_table change BOOK_ID Varchar2 (4);

    ALTER table Target_table add ISBN_10 Varchar2 (13), null;

    ALTER table drop TITLE Target_table;

    There are two simple ways to do so.

    1. use free sql Oracle development tools

    http://www.Oracle.com/technetwork/developer-tools/SQL-Developer/downloads/index.html

    Simply select 'Tools - Diff of the database' and go through the menus

    Here is an article from Oracle by Jeff Smith that shows how do

    http://www.Oracle.com/technetwork/issue-archive/2012/12-Sep/o52sqldev-1735911.html

    >

    Quickly copy, compare and synchronize databases with Oracle SQL Developer.

    >

    2 use the DBMS_METADATA_DIFF package - see the commercial doc

    http://docs.Oracle.com/CD/E11882_01/server.112/e22490/metadata_api.htm#BABIDHGE

    >

    Using the DBMS_METADATA_DIFF API to compare the metadata of the object

    >

    If you look at step 14 of this article, you will see the result of the use of COMPARE_ALTER:

    >

    14. compare the results by using the navigation API DBMS_METADATA_DIFF:

    SQL > SELECT dbms_metadata_diff.compare_alter ('TABLE', 'TAB1', 'TAB2') FROM dual;
    ALTER TABLE 'SCOTT '. "' TAB1 ' ADD ("MGR"NUMBER (4,0))
    ALTER TABLE 'SCOTT '. "' TAB1 ' DROP ("JOB")
    ALTER TABLE 'SCOTT '. "' TAB1 ' CHANGE ('ENAME' VARCHAR2 (20))
    ALTER TABLE 'SCOTT '. "' TAB1 ' ADD A KEY ('EMPNO') PRIMARY AID INDEX
    PCTFREE, INITRANS 10 2 STORAGE (INITIAL 16384 MINEXTENTS THEN 16384 1)
    MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 USER_TABLES
    (VALEUR PAR DÉFAUT) ACTIVATE ALTER TABLE "SCOTT" TAB1"AND RENAME"TAB2 ".

    1 selected line.

    >

  • Where can I configure the rule of naming for the columns of the child?

    I have the logic model below:

    https://www.dropbox.com/s/1eux01rrkmcn84f/child_logical.PNG

    When I have the engineer I get the following physical model:

    https://www.dropbox.com/s/pwl2zxkvuigdr5q/child_physical.PNG

    How can I configure that no entity name prefix must be added to the name column?

    Columns must be named create_ts, modify_ts, delete_ts and attribute_1. (upcase all is ok).

    I tried to change the model of standard naming for attribute relationships, but it has no effect.

    Can someone give me a hint?

    I found a way to resolve names with a custom transformation script.

    ceving: abuse of inheritance for the coating with SQL Developer

    But the behavior of the new Modeler data seems to be different from the old. I create a model with the old. And now I'm still working on the model by the new. And for some columns, not the name of the inserted table and other tables. This occurs in the same model. I think that there still is some sort of bug in the problem.

  • Can we use the AGO on presentation columns that is in the formula for the column

    Hello

    I use obiee 10g

    I tried to use the AGO in the formula in the column and using the columns of the presentation but the error.

    Please suggest.

    Pull the measure in the criteria and fx-> Filters-> pull date column-> Advanced button-> convert this filter in SQL
    and use something like below

    Time.Date<= current_date="">
    Time.Date > = TIMESTAMPADD (SQL_TSI_DAY,-(365), CURRENT_DATE)

    So that any point of time this measure see the last 365 data.

    If brand aid

    on the other
    Thank you
    Published by: Srini VIEREN on 10 April 2013 08:51

    Try updating all your messages to get a suggestion for your new future/post

    Published by: Srini VIEREN on 29 April 2013 07:21

Maybe you are looking for

  • Address book import of csv file gets empty address book

    I have a .csv file from a Windows 'Contacts' window. It contains four hundred entries, each composed of a name and E-mail address. The first line of the file says .csv "name, Email '; the entries are separated by returns and the areas that fall withi

  • Cannot configure synchronization, can not delete 'old' sync acct, cannot create new account (email "already in use") storage = 0,0 FUBAR! Help!

    About 1 month ago received the message "Server error" sync a new device (Virtual Machine), I'm sorry, but I did not copy the exact message, but remember you that the notice was to try later. Long story short, after 3 days worth of 'try later' with th

  • SP3 update: problems, can only start in safe mode

    Windows XP Home Edition: update to SP3, in the hope that it would, among other things, allow me to install the windows update service. Unfortunately, I can only boot in safe mode. If I try the normal startup, it goes into a boot loop. By that I mean

  • Widdows medial player 11

    I use Windows XP service Pack 2 and Windows Media Player 11 help. I connect using start programs/Media Player. Goes the icon to the taskbar, and when I click on the impropriety, it opens in reduced position. However, I can't get the player to maximiz

  • PCI device and network controller drivers

    I have a Presario CQ57 and in Device Manager, network controller has no driver and I'm not and my WI - FI does not work it shows that he is disabled from device manage. Help, please And a more... Peripheral PCI generic bluetooth adapter has no driver